L
Lee
I have a form on which I've placed two option buttons in a
frame. When one option is selected, I want to open a
form, while the second option will run a macro to open
report. The value for optInd is 1 and the value for
optAll is 2. I noticed that VB does not seem to offer a
click event for option buttons, so I added a command
button to the form, and depending on which option is
selected when the button is clicked, that action will be
carried out. This is the code I've written:
Dim Report
Dim stFormInd As String
Dim stRptAll As String
stFormInd = "frmRptSelectIndVendor"
stRptAll = "macContactsByVendor"
If optInd = 1 Then
DoCmd.OpenForm stFormInd, , , stLinkCriteria
ElseIf optAll = 2 Then
DoCmd.RunMacro stRptAll
End If
It's given me error 2427 "You have entered an expression
that has no value."
What am I doing wrong?
frame. When one option is selected, I want to open a
form, while the second option will run a macro to open
report. The value for optInd is 1 and the value for
optAll is 2. I noticed that VB does not seem to offer a
click event for option buttons, so I added a command
button to the form, and depending on which option is
selected when the button is clicked, that action will be
carried out. This is the code I've written:
Dim Report
Dim stFormInd As String
Dim stRptAll As String
stFormInd = "frmRptSelectIndVendor"
stRptAll = "macContactsByVendor"
If optInd = 1 Then
DoCmd.OpenForm stFormInd, , , stLinkCriteria
ElseIf optAll = 2 Then
DoCmd.RunMacro stRptAll
End If
It's given me error 2427 "You have entered an expression
that has no value."
What am I doing wrong?