Dec 14, 2005 #1 herd Technical User Joined Jun 23, 2003 Messages 46 Location US How can I used a command button in a form to filter all records in which a check box is checked on that record. Thanks Gary
How can I used a command button in a form to filter all records in which a check box is checked on that record. Thanks Gary
Dec 14, 2005 1 #2 mp9 Programmer Joined Sep 27, 2002 Messages 1,379 Location GB If your button is called cmdFilter, and the field to which your checkbox is bound is a boolean called CheckIt (untested): Code: Private Sub cmdFilter_Click() On Error GoTo Err_cmdFilter_Click DoCmd.ApplyFilter , "CheckIt = -1" Exit_cmdFilter_Click: Exit Sub Err_cmdFilter_Click: MsgBox Err.Number & ": " & Err.Description, vbExclamation Resume Exit_cmdFilter_Click End Sub Upvote 0 Downvote
If your button is called cmdFilter, and the field to which your checkbox is bound is a boolean called CheckIt (untested): Code: Private Sub cmdFilter_Click() On Error GoTo Err_cmdFilter_Click DoCmd.ApplyFilter , "CheckIt = -1" Exit_cmdFilter_Click: Exit Sub Err_cmdFilter_Click: MsgBox Err.Number & ": " & Err.Description, vbExclamation Resume Exit_cmdFilter_Click End Sub