Query using form fields as criteria (1 Viewer)

Drand

Registered User.
Local time
Tomorrow, 04:55
Joined
Jun 8, 2019
Messages
179
Hi

I hope I explain this properly!

I have a query that includes three fields, "Group", "SubGroup" and "StockItem" where the items in subgroup are related to groups and stockitems are related to subgroups.

I have a form where the user selects each of these from separate comboboxes.

At present, to run the query I have referenced each of these to the form combobox fields in the query criteria.

That is fine if all I want to see is the data for the stockitem field, as all three criteria are applied, and works really well.

What I would like to achieve is essentially a drill down of the data in stages.

If the user selects the group combo then the data shows all items for the entire group. If they then select a subgroup under that group then only the data for the subgroup is displayed and finally if they select the stockitem then only that data is displayed.

As I cannot edit the criteria in a query programmatically, I am not sure how to achieve this.

Would really appreciate any assistance on this.

Thanks
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:55
Joined
Jul 9, 2003
Messages
16,272
I have a "Search Form" that I thought might be of interest to you.

It's on my website here:-

 
Last edited:

plog

Banishment Pending
Local time
Today, 13:55
Joined
May 11, 2011
Messages
11,638
I wouldn't make the query what you view. Instead I would either make a form or a report to view the data. That form/report would be based on your current query but with all the criteria removed. Then you would open the form/report with the appropriate VBA:



One of the arguments of those is filter criteria. You would use your existing form and its input to build a filter string and then open the form/report to just the data you want.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:55
Joined
May 21, 2018
Messages
8,525
Lately I have been incorporating this concept in a lot of forms. Easy and super flexible.
 

Users who are viewing this thread

Top Bottom