macro run conditions

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

Guest

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
 
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
 
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.
 
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
 
Sorry, Barney, got caught by the copy/paste bug!
[NameOfYourFirstCheckbox] And [NameOfYourSecondCheckbox]
 
Back
Top