0

I've a form like newform1 and a table newtbl1... in form I've a unbound checkbox "chkbx1" and in the newtbl1 i have a field name chk_stat which is a checkbox (yes/no) now i want to link this chkbx1 with the chk_stat. mean when i check/uncheck checkbox1 same thing happen in the table using SQL INSERT statement...

thank you

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by aktharshaik
0

Yes and No values are fields that contain only one of two values (Yes/No, True/False, or On/Off). Its size is only 1 bit.
Which means it can hold only 1 bit of data. (either a 0 or 1)

when using the insert statement put 0 for No and 1 for Yes

Like

INSERT INTO MyTable (Name, Age, chk_stat) VALUES ('John', 25, 0)

where chk_stat will be stored as No. If you want it to be yes just replace 0 with 1.

0

very well thank you and one more thing when i assign my form objects (like txtName and txtAge) to the vb variable (like vbName and vbAge) and than try to push the form information into table MyTable than what i got is the same variable names which i just use... :( :( :( :( :(

INSERT INTO MyTable (Name, Age, chk_stat) VALUES ('txtName', 'txtage', 0)

thanks once again

regards

0

You must create a string such that it should append the values of the controls, not the control name.

INSERT INTO MyTable (Name, Age, chk_stat) VALUES ('" & txtName & "', '" & txtage & "', 0)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.