Filter using option groups and check boxes

Local time
Today, 11:10
Joined
Sep 1, 2019
Messages
4
Hello,

If this question has already been posed then I apologize for not seeing it. Here is what I got...

I am creating a document management system and the way we will filter will be by using an option group and check boxes. The option group is used to filter the document type(ie: procedure, form, etc) and check boxes to filter out the department the doc type applies to(CNC, Screw Machine, HR, etc). As of right now I have the option group filtering out the document types the right way and the check box narrows it down by department; however, when I unselect the check box and try to use the option group to select a different doc type it is not working.

I do not have access to my program right now, but I will do my best to describe my process..

I am using a split form as my display. The option group filters using a query, then on the AfterUpdate event I have

form_DocsTQ.requery.

For the check box I have in the AfterUpdate event..

Code:
If checkbox1.value=true then
Me.filter=“[department name]=yes”
Me.filteron=true
Else
Checkbox1=false
Me.filteron=false
Form_DocsTQ.requery
End if
 
Last edited by a moderator:
when I unselect the check box and try to use the option group to select a different doc type it is not working.
That could mean anything. However, what looks suspect:
You have a department named "yes"?? The dept name is text so it needs to be delimited:
Me.Filter = "[department name] = 'yes'"
also, the slanted quotes usually cause issues - not sure how they got here (you probably did not cut and paste from your code, so maybe not a problem)

I'm not a fan of your approach. If there are or could later be several departments, a combo box would be the way to go. Several checks will complicate code, not to mention that you usually shouldn't be adding controls to accommodate new field options like Dept. Same can be said for document types - a combo box would be better.

If that doesn't help, explain what "doesn't work" means.
 

Users who are viewing this thread

Back
Top Bottom