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

Form Checkboxes

Status
Not open for further replies.

f5snopro

Technical User
Feb 6, 2003
23
US
How can I get a form check box to input values into a table as 0's and 1's instead of 0's and -1's?
 
Hi,

The checkbox values are in fact True or (-1) or False or (0).

You can't change the 'value' if the checkbox is bound to a field in a table - because these are it's values, end of story.

The only other way would be to bind aother control (such as a textbox) to the field, when the checkbox is clicked use this code....
[tt]
If (myChkBox) then 'If checkbox ticked then
MyTxtBox = 1
else
MyTxtBox = 0
endif
[/tt]
Another way instead of the code would be to add the following to the textbox's 'Control Source' property...
[tt]
iif(myChkBox=True,1,0)
[/tt]
which does the same thing.

Bit of an hassle because at the end of the day you will still be referring to 1's and 0's, except you'll always have to 'interpret' the values instead of letting Access/VB automatically do it for you.

Kind regards,

Darrylle


"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
There has got to be a better way to do this...What a hassle to bind it to a textbox to "interpret" it. No doubt it will work, but does anyone know of a better way? Maybe a script or something I could run on the table to convert all the -1's to 1's? I'm going to use this data piped to an Excel spreadsheet for calculations...this why it is so important. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top