T
Thomas
I have a form with multiple option buttons on it. Each option has a
corrosponding function that will run if it is selected and a command button
is clicked. I normaly would do it as an If statement but due to the large
number of options it is making the code a bit unwieldy. I have each function
named Create_Single and then the option number (example: Create_Single1,
Create_Single2, Create_Single3, etc).
Each number ending the function name corrosponds to the frame value (1, 2,
3, etc). The code I have tried is as follows:
'Declare Variables
Dim Sel As Integer
Dim Report As Variant
'Determine which opton was selected.
Sel = fra_ReportSelectionsSingle.Value
Report = "Create_Single" & Sel
Call Report
This of course gives an error stating that the function is not defined as it
appears that it is trying to call a function called "Report" rather than
using the variable value for the function name. Anyone have any ideas or is
an If statement going to be the only option for this?
corrosponding function that will run if it is selected and a command button
is clicked. I normaly would do it as an If statement but due to the large
number of options it is making the code a bit unwieldy. I have each function
named Create_Single and then the option number (example: Create_Single1,
Create_Single2, Create_Single3, etc).
Each number ending the function name corrosponds to the frame value (1, 2,
3, etc). The code I have tried is as follows:
'Declare Variables
Dim Sel As Integer
Dim Report As Variant
'Determine which opton was selected.
Sel = fra_ReportSelectionsSingle.Value
Report = "Create_Single" & Sel
Call Report
This of course gives an error stating that the function is not defined as it
appears that it is trying to call a function called "Report" rather than
using the variable value for the function name. Anyone have any ideas or is
an If statement going to be the only option for this?