Check box need the correct syntax

kee2ka4

Registered User.
Local time
Today, 00:15
Joined
Mar 11, 2009
Messages
11
Hey peeps,

I have added a check box in an access application, which when ticked and on pressing the submit button, it builds a query and displays the result. I am not sure what is the correct syntax in VBA, that would do the following:IF checkbox is ticked THAN do something, so in my case add an extra bit to the query. Here is my code below for the checkbox but it doesn't work. I suspect its the wrong syntax I am using:

Code:
If Me.Check16.Value = vbChecked Then
        If strWHERE <> "" Then strWHERE = strWHERE & " AND "
        strWHERE = strWHERE & "qryExamTaken.fkOverallstatus = 1"
        End If
If Me.Check16.Value = vbChecked is this correct? Can someone point me in the right direction.

Thanks,
Ket
 
A checked checkbox in Access is either TRUE, YES, or -1 (not 1).
 

Users who are viewing this thread

Back
Top Bottom