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

Trouble with yes/no boxes

Status
Not open for further replies.

etislost

Technical User
Nov 23, 2003
19
0
0
US
Howdy!

I'm kind of new to Access. I am struggling in an effort to find a way to have a yes/no checkbox on a form input numeric values of 1/0 respectively into a database. In other words, if the user clicks/doesn't click the yes/no box on a form, can I get Access to enter a 1/0 on the datasheet? If yes, what do I need to do? If no, please let me know.

Further info...the yes/no box I am currently using is a single box which is either empty, or, upon clicking, has a check in it. On the datasheet, the field shows a box, either empty or checked.

Thanks

 
A Yes/No field is a 1-byte field on a database. It stores a 0 for false and -1 for true. By default, a yes/no box shows up as a checkbox on datasheets and forms. No matter how it DISPLAYS it is still either 0 or -1.

If you insist on having 1 instead of -1 in your table, don't bind the checkbox on the form to the table field. Instead, in the AfterUpdate event of the checkbox, put coding to set the table field to 1 if the checkbox is True or 0 if the checkbox is false.

If you really want to see a 0 or -1 in your table, you can open your table in Design mode and change the Display Control property of the Yes/No field to be Text Box instead of Check Box.


[shadeshappy] Cruising the Information Superhighway
[sub] (your mileage may vary)[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top