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

No .Value Attribute for a Checkbox??

Status
Not open for further replies.

DBLoser

MIS
Apr 7, 2004
92
US
I have a form with a checkbox and am using a button with the following code:

strSQL = "INSERT INTO tempEmployees ([Completed]) Values('" & Me.cbxCompleted.Value & "')"

The problem is, when I type out Me.cbxCompleted.Value ... .Value is not an attribute of the list. So how can I capture the state of the checkbox with a strSQL statement?
 
If you want to know what the "value" is of a checkbox

Dim myCheckBox as String
mycheckbox=me.cbxCompleted

should do it.
 
I inserted the code...

Dim myCheckBox as String
mycheckbox=me.cbxCompleted

And changed the SQL statement and when I run it I get runtime error 438, object does not support this property or method. When I mouse over mycheckbox=me.cbxCompleted it shows myckeckbox="". It still wants the value of something, which again, is not a property of a checkbox.

Thanks for the help!
 
what verison of access are you using? i tried in access2k3
and checkes boxes have a value proptity
 
Same here, Access 2003. Did you create a form and add a checkbox from the toolbox? I just dragged one onto the form and renamed it.
 
Stop the presses! I made a mistake. I changed the name of the label to cbxCompleted and not the name of the actual checkbox. I knew it was something stupid.

Thanks for all the help!
 
What properties does the Checkbox have?

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top