macro run conditions

B

Barney

Hi,

I'm trying create a macro to start from a when a check box is ticked, but
only when another check box is ticked. I've tried creating one and attaching
to the click command to a box, but the macro runs everytime, not just when
the other check box is ticked!
Sure i've made this sound more complicated than it actually is, but does
anyone know what the condidtion on the macro should be?

thanks
Barney
 
S

Stephen English

Hi Barney
If you have too check boxes cbx1 and cbx2 then on the AfterUPdate event of
cbx2 put this code
If Me.cbx1 = True And Me.cbx2 = True then ' THe =True is not actually needed
'Whatever you want to do in here!
End if
 
S

Steve Schapel

Barney,

In the Condition column of your macro design, something like this...
[NameOfYourFirstCheckbox] And [NameOfYourFirstCheckbox]

Also, I would not assign this macro on the Click event of the second
checkbox, it should be on its After Update event. Or maybe the Click
event of a command button.
 
B

Barney

Hi Steve & Stephen,

Its working like a dream now.

Many thanks
Barney

Steve Schapel said:
Barney,

In the Condition column of your macro design, something like this...
[NameOfYourFirstCheckbox] And [NameOfYourFirstCheckbox]

Also, I would not assign this macro on the Click event of the second
checkbox, it should be on its After Update event. Or maybe the Click
event of a command button.

--
Steve Schapel, Microsoft Access MVP
Hi,

I'm trying create a macro to start from a when a check box is ticked, but
only when another check box is ticked. I've tried creating one and attaching
to the click command to a box, but the macro runs everytime, not just when
the other check box is ticked!
Sure i've made this sound more complicated than it actually is, but does
anyone know what the condidtion on the macro should be?

thanks
Barney
 
S

Steve Schapel

Sorry, Barney, got caught by the copy/paste bug!
[NameOfYourFirstCheckbox] And [NameOfYourSecondCheckbox]
 

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