Ok, so here is my situation...(and bear with me, I don't have that much experience with VBA for Access)
I want to make a form that gives my client the ability to select from a bunch of 'check boxes' and when the client hits a command button "Run Query" it will filter a master Query (named "Query for Query Builder") I have made for their exact sought after info.
These check boxes are unbound to any controls and I just need to use them to activate the filters for the master query.
For now, I just have one check box to try to get the code right and the check box is named "GBSize_1X1X1" which should filter a control in the master query called "Description". Here is the code I have right now:
Private Sub GBSize_1X1X1_Click()
If [GBSize_1X1X1] = 1 Then
DoCmd.ApplyFilter , "Query![Query for Query Builder]![Description] = '1X1X1'"
End If
End Sub
Can anyone help me? I don't get any error messages when this code is run, but when I goto the query it is supposed to filter there is no applied filter. Also, I tried putting "If [GBSize_1X1X1] = Yes" in the if statement since I forget how Access reads check boxes, same result.
I want to make a form that gives my client the ability to select from a bunch of 'check boxes' and when the client hits a command button "Run Query" it will filter a master Query (named "Query for Query Builder") I have made for their exact sought after info.
These check boxes are unbound to any controls and I just need to use them to activate the filters for the master query.
For now, I just have one check box to try to get the code right and the check box is named "GBSize_1X1X1" which should filter a control in the master query called "Description". Here is the code I have right now:
Private Sub GBSize_1X1X1_Click()
If [GBSize_1X1X1] = 1 Then
DoCmd.ApplyFilter , "Query![Query for Query Builder]![Description] = '1X1X1'"
End If
End Sub
Can anyone help me? I don't get any error messages when this code is run, but when I goto the query it is supposed to filter there is no applied filter. Also, I tried putting "If [GBSize_1X1X1] = Yes" in the if statement since I forget how Access reads check boxes, same result.