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

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.

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

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)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.