Is the record source of the form set to the table? Is the control source of the checkbox set to the field in the table? If both of these are true then the table should automatically update.
Yeah, I have set both the fields. What should I write in the query so that when the check box on the form is set , the check box in table also is set?
I have kept the field in the table as yes/no type. So it is displaying check box in the table also.
If I use normal Insert query as { All the fields are normal text and number type , but a field with name 'Disabled' is a check box} shown below:
DoCmd.RunSQL 'INSERT into [tblPatient] ([MRNumber], [SSN] , [FirstName], [MI], [LastName]) VALUES (MRNumber, SSN , FirstName, MI, LastName);'
Now my concern is how to insert the value of the checkbox. If I don't give Disabled field in the query list as shown below it is giving an error saying 'number of query values and destination fields are not same'.
If I give it like below :
DoCmd.RunSQL 'INSERT into [tblPatient] ([MRNumber], [SSN] , [FirstName], [MI], [LastName], [Disabled]) VALUES (MRNumber, SSN , FirstName, MI, LastName, D);'
Where D is the variable holding the value of the checkbox (either 0 when not set or 1 when set).
Then when I am trying to insert values it is displaying a msgbox saying to enter the value of D.
Can you suggest me what changes I need to make to this query.
Thank you,
Pdesh3.