Code Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a problem combining the following code.
Private Sub Option42_AfterUpdate()
If Me.Option40 And Me.Option42 = True Then
Me.Checkbox1 = True
Else
Me.Checkbox1 = False
End Sub
TRYING TO COMBINE WITH :
Private Sub Checkbox1_AfterUpdate()
If Me.Checkbox1 = True Then
Me.Q1 = 3
Else
Me.Q1 = 0
End If
End Sub

Can someone help. My goal is that each time option box 40 and 42 are
selected then checkbox1 gets checked off and when checkbox1 is marked off a
value of 3 is given and if checkbox is not selected a value of 0 is given.
 
scott04 said:
I am having a problem combining the following code.
Private Sub Option42_AfterUpdate()
If Me.Option40 And Me.Option42 = True Then
Me.Checkbox1 = True
Else
Me.Checkbox1 = False
End Sub
TRYING TO COMBINE WITH :
Private Sub Checkbox1_AfterUpdate()
If Me.Checkbox1 = True Then
Me.Q1 = 3
Else
Me.Q1 = 0
End If
End Sub

Can someone help. My goal is that each time option box 40 and 42 are
selected then checkbox1 gets checked off and when checkbox1 is marked off
a
value of 3 is given and if checkbox is not selected a value of 0 is given.

Try this:

If Me.Option40 = True ANd Me.Option42 = True Then
Me.Checkbox1 = True
Me.Q1 = 3
Else
Me.Checkbox1 = False
Me.Q1= 0
End If

Carl Rapson
 
Thanks it works!

Carl Rapson said:
Try this:

If Me.Option40 = True ANd Me.Option42 = True Then
Me.Checkbox1 = True
Me.Q1 = 3
Else
Me.Checkbox1 = False
Me.Q1= 0
End If

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top