Filter on Checkbox

raweber

Registered User.
Local time
Today, 08:23
Joined
Jul 28, 2011
Messages
41
Filter on Checkbox - Resolved

I have a Yes/No field (Archive) in my table for archived studies that is tied to a checkbox (chkArchive) on a form. I would like to hit a button (btnActive) and filter out all the records for which that box is checked. Currently I'm calling an On Click event:

Code:
Private Sub btnActive_Click()
    Me.Filter = "frmMain.[ChkArchive] = 0"
    Me.FilterOn = True
End Sub

This works, except when I press the button a dialog comes up requesting a parameter value for frmMain.[chkActive]. If I enter "0" it works. If I enter anything but "0" in the dialog that comes up, it filters everything.

Seems like this should be easier than it is (and it probably is...)
 
Last edited:
You want the field name, so try

Me.Filter = "Archive = 0"
 
See, I was right, it was easy!

Thanks, Paul
 

Users who are viewing this thread

Back
Top Bottom