: I have a simple form with a two option buttons op1 and op2.
: Selecting op1 should execute the following lines of code
No. Clicking on the CommandButton1 button should execute
your lines of code. To execute these lines on a change of op1
you would need this.
Private Sub op1_Change()
Dim plate As Boolean
Load Frm
Frm.Show
plate = Frm.op1.Value
If plate = True Then
LookAhead = 110
Else
LookAhead = 93
End If
End Sub
Or perhaps:
Private Sub op1_Click()
Dim plate As Boolean
Load Frm
Frm.Show
plate = Frm.op1.Value
If plate = True Then
LookAhead = 110
Else
LookAhead = 93
End If
End Sub
Neither one of these makes sense because Frm is already
loaded and shown (otherwise op1 could not be clicked).
: however, I am getting an error Object variable or With block
: variable not set error.
You should be getting a "form already shown..." error.
Perhaps you are not showing us enough code.