Filter by Check Box

DBL

Registered User.
Local time
Today, 16:20
Joined
Feb 20, 2002
Messages
659
I'm requerying a subform based on selections made on the main form. One of the fields is a check box. This is the code I've got on the Show Data button

On Error Resume Next
db.QueryDefs.Delete ("Search_Query")
' TO DO: Turn normal error handler on when this condition is finished.
On Error GoTo 0

where = Null
where = where & (" AND [IDTrans]= " + Me![Combo2])
where = where & (" And [IDTransPd] = " + Me![Check7])


Set QD = db.CreateQueryDef("Search_Query", "Select * from qryTransWork " & " Where " & Mid(where, 6) & ";")

If DCount("*", "Search_Query") <= 0 Then
MsgBox "No Records Found"
Exit Sub
End If

Forms!frmTransWork!sfrmTranscriptionistsPd.Form.RecordSource = "Search_Query"
End Sub

I'm getting a type mismatch error on where = where & (" And [IDTransPd] = " + Me![Check7]) so I'm obviously referencing the check box incorrectly but not sure what to do.

Thanks

DBL
 
well from i can see you are trying to reference a value from the checkbox what you need to say is whether the chkbox is selected or not. I dont usually deal with chkboxes but being boolean type of data it cant be difficult to figure out.

It will be something like: Me!Check7!Enabled = True
 
Sorry just saw mistake:

Me![Check7].Enabled = True
 

Users who are viewing this thread

Back
Top Bottom