Fussy Form Filtering

Alex2015

Registered User.
Local time
Yesterday, 19:26
Joined
Sep 1, 2015
Messages
55
Just a few more humps to get over...

Only using one line of VBA (which I don't know), I was able to accomplish the following:

-Built a form based on a junction table which contains employees, the work areas they're assigned to, the training modules they've completed, & the completion dates for said modules.

-Built an unbound combo box that allows the user to select the work area, hence filtering the form to only show a specific work area (great!).

-To make this happen, I had to add the following line to the After Update event of the combo box: Me.Requery.

-The query itself has the following fields: employee ID, employee name, work area, training module, the work area ID with the criteria based on the selection the user makes from the combo box, & lastly the completion date.

Everything works flawlessly right now; however, the user is going to want to update the completion dates for "certain" training modules & doesn't want to necessarily see every training module that every employee has completed in one shot. Basically, I want to filter the form a bit further; once for the work area (which I've accomplished thus far) & one more time for the training module using another combo box. Hours of searching hasn't helped me yet. Thank you in advance.
 
Simplest is probably adding the second criteria and using this, perhaps for both:

http://access.mvps.org/access/queries/qry0001.htm

Fair warning, design view will usually change that once you save it to break it into a separate field. It still works, but looks goofy.
 
Simplest is probably adding the second criteria and using this, perhaps for both:

http://access.mvps.org/access/queries/qry0001.htm

Fair warning, design view will usually change that once you save it to break it into a separate field. It still works, but looks goofy.

Sorry; I had to take a break. Tried it. Put the appropriate criteria line in the query but it still only filters the form once (per the work area) & not also by the training module. At first I thought maybe the me.requery code had to be written for the second combo box, which I did, but it still doesn't filter the form X2.
 
I realize that once the form is filtered according to work area, the user can then just right-click on a training module & choose the "Equals to" option. That's great but I wish to make a combo box for that too.
 
Did you use the same method for both, and put both criteria on the same line?
 
Did you use the same method for both, and put both criteria on the same line?

Ah ha! That was part of my mistake. So including the "Is Null" statements just displays everything on the form with no selections it seems like. I actually preferred the form to preload totally blank so I took out the Null statements altogether.

I could've sworn I tried this method before with the criteria line for both combo boxes but couldn't get it to work. It was only now that I typed the Me.Requery code for the second combo box in addition to what you suggested. Perhaps this is what made the form operate properly?
 
Yes, the Requery would be necessary behind both combos, to make the query run again with the new selection.
 
Yes, the Requery would be necessary behind both combos, to make the query run again with the new selection.

Thanks a bunch for solving my problem man. I appreciate the help.
 
Happy to help!
 

Users who are viewing this thread

Back
Top Bottom