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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong with this?

Status
Not open for further replies.

MadHacker

MIS
Dec 20, 1999
21
US
If (Forms![GC1]!Check1.Value) Then DoThis()<br><br>I am trying to use the above to see wether a checkbox is checked. What am I doing wrong? I have the form opened and the code running from an event on that form.<br>
 
If Form ... Value = ?????? Then DoThis()<br><br>Actually, there may also be a problem in the syntax for the checkbox.<br><br>Try <br><br>If Me!Check1.Value = 1 Then&nbsp;&nbsp;&nbsp;(or Me.Check1.Value)<br>&nbsp;&nbsp;&nbsp;Do This<br>End If<br><br>I would also rename my checkboxes and other controls so they have a meaning, ckHungry, for example.<br><br>Then Me!ckHungry.Value = 1 Then<br><br><br><br>Dan
 
You can just use this:<br><br>If Me!Check1 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;Do whatever ........<br>End If<br><br><br>The default for a check box is value, so you don't have to specify<br>value = true or false. <p>Jim Lunde<br><a href=mailto:compugeeks@hotmail.com>compugeeks@hotmail.com</a><br><a href= Application Development
 
<br>&nbsp;Thank you but neithor one of those are working. I am still gettting an error. It says &quot;Microsoft Access Run-Time error '2447':<br><br>There is an invalid use of the . (dot) or ! operator or invalid parentehesis.<br><br>I tried exactly the way it is shown above by jimmythegeek and the way macrodan shows it and I still can't get past this message!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top