check box problem

  • Thread starter Thread starter mbrindley
  • Start date Start date
M

mbrindley

Guest
I have a check box (tick box) and i cant figure out how to put in some code so that it recognises like the 2 states, ie, when it is ticked, and then un-ticked. You can only seem to be able to do it so that i does and operation when it is ticked!? What i want is so that when u tick the box, it hides a subform, and when you un-tick it, it shows again...HELP HELP! SOS!

thanks guys...
 
if me!yourcheckbox = true then
forms!yourform!yoursubform.visible=true
else
forms!yourform!yoursubform.visible=false
end if
 
First set the "Default" property of the chkbox to 0 (unchecked).

Now use the following example using the "After Update" event of the chkbox:

Private Sub YourChkboxName_Click()
Me.SubformControlName.Visible = Not Me.YourChkboxName
End Sub

"SubformControlName" should be the name of the Sub Form control (not the name of the subform) on the Main Form.

"YourChkboxName" should be the name of your chkbox.

HTH
RDH
 

Users who are viewing this thread

Back
Top Bottom