Tick Box problem

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

I have a series of tickbox controls on a form. When the user clicks on them
a form is opened, I used the onclick event to do this. However if the user
clicks the tickbox in error the form will open and then if they unlick it if
they have clicked in error the form opens again. Is there anyway that I can
stop the form opening on unclick?
 
-----Original Message-----
I have a series of tickbox controls on a form. When the user clicks on them
a form is opened, I used the onclick event to do this. However if the user
clicks the tickbox in error the form will open and then if they unlick it if
they have clicked in error the form opens again. Is there anyway that I can
stop the form opening on unclick?

--
Tony Williams


.
set a procedure to run from the tickbox's On Click event,
as
Private Sub TickBox_Click()
If Me!TickBox Then
DoCmd.OpenForm "FormName"
End If
End Sub

i didn't test above, so...if On Click doesn't work, try
using the After Update event.

or you could nip the problem in the bud by automatically
unticking the box when the form opens, as
Private Sub TickBox_Click()
If Me!TickBox Then
DoCmd.OpenForm "FormName"
Me!TickBox = False
End If
End Sub
again, try the After Update event if On Click doesn't work.
 
Thanks Tina but the form still opens on the unclick of the tick box. I want
to stop the form opening if the user unchecks the tickbox
Thanks
Tony
 
okay, tony, i was awake enough to test the code this
morning. if you place the first procedure on the tickbox's
On Click event, it will run correctly and give you the
result you want. if you remove the procedure from the On
Click event, and place either the first or second
procedure on the After Update event, the one you use will
run as i described below.
really! :-)

by the way, a checkbox has a boolean value, so in an
If...Then statement, both of the following expressions
evaluate the same:
If Me!Tickbox Then
If Me!Tickbox = True Then
 
Thanks Tina worked just fine
Tony
tina said:
okay, tony, i was awake enough to test the code this
morning. if you place the first procedure on the tickbox's
On Click event, it will run correctly and give you the
result you want. if you remove the procedure from the On
Click event, and place either the first or second
procedure on the After Update event, the one you use will
run as i described below.
really! :-)

by the way, a checkbox has a boolean value, so in an
If...Then statement, both of the following expressions
evaluate the same:
If Me!Tickbox Then
If Me!Tickbox = True Then
 
Back
Top