Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button help- 2

Status
Not open for further replies.

thowe

Technical User
Jun 8, 2001
45
US
Hello- I would like to have one of my buttons automatically make a check in a check box. Is that possible? I am a relatively new Access developer and NOT a programmer- although I'll write code if someone knows the code to write and tells me where to put it. Maybe this is an "if, then" statement?
 
In the buttons click event put

CheckBoxName = Not CheckBoxName

Good luck B-) ljprodev@yahoo.com
ProDev
MS Access Applications
 
Lonnie:

I like that, never seen "Not" used that way. A star answer if I ever saw one!

Joe Joe Miller
joe.miller@flotech.net
 
This is not working. I have gone in and created a macro that runs the above code that was advised by Lonnie =[available in cc?]=Not [available in cc?] it is not working. I go into the properties of the button and try to type that in directly and it doesn't work. I'm not sure about how to create the macro for this...any help? Just want the check box in [availabe in cc?] to check when I click a button that opens a form.
 
Try using code as suggested by LonnieJohnson

Private Sub Command0_Click()

Check1 = Not Check1

End Sub

This code will 'Check' and 'Uncheck' the check box every time you click the command button. If you just want to check the check box then change the code to...

Private Sub Command0_Click()

Check1 = True

End Sub
 
Why are you creating a macro? Simply put what lonnie said in the Click event of the button (Right-click the button, properties, All, On Click, press the icon with the three dots, Code, then type what lonnie said:

CheckBoxName = Not CheckBoxName

simple and easy
 
Thank you HiBoo -- although I wasn't entirely sure where to put the code at first, I figured it out! Thank you, another hurdle overcome!!!!!!

~Tanya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top