Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Juana Fisher   on Dec 07 In MS Office Category.

  
Question Answered By: Damon Jones   on Dec 07

: 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.

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Object variable or With block variable not set error? Or get search suggestion and latest updates.


Tagged: