Checkbox control source problem

jack1234

Registered User.
Local time
Today, 14:58
Joined
Jun 2, 2007
Messages
16
For the following code chk is a check box, ischecked is a yes/no field.

Dim sSQL as string
sSQL = "Select [ischecked] from tbluser where userId='abc'"
chk.ControlSource = sSQL
chk.Requery

But when I run the following vba code, no matter ischecked is yes or no, it always shows me the checkbox is unchecked. Am I doing anything wrong? If yes how to correct it?
 
The controlsource for the checkbox needs to be in the recordsource of the form, or a calculated value.

The controlsource for the checkbox in this case should just be your field ischecked if that field in your table "tbluser" is in the form's recordsource.
 

Users who are viewing this thread

Back
Top Bottom