check box that triggers macro

E

EstherH

Hi again,

How does one get a check box created by the control toolbox to trigger a
one condition when checked and another when not checked?

For far I have found that Sub CheckBox1_Click() can be used to trigger an
event. But this triggers the same event whether checking or unchecking.

What is the if statement that captures the checked and unchecked values for
this box?
 
C

Chuck Henrich

Use the following

Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
'checkbox ticked - do something
Else
'checkbox not ticked - do something different
End If
End Sub

HTH
 

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

Top