Don't ask user for Query Parameters (1 Viewer)

GBalcom

Much to learn!
Local time
Yesterday, 18:30
Joined
Jun 7, 2012
Messages
459
I have a form with a subform (qry) on it. I want the form to load, then the user fills out some cbo boxes in the header, which then pass that information to the subform (fills out the parameters of the query).

I want the subform to be invisible or blank until this happens, and the query not ask the user for the query parameters. Any ideas? Thanks. :banghead:
 

isladogs

MVP / VIP
Local time
Today, 02:30
Joined
Jan 14, 2017
Messages
18,209
Set the subform hidden by default.
Use the combo selections to build filter criteria for the subform.
When user has finished making selections, click a button to run code which builds the record source and makes the subform visible

You could have a look at two of my example apps which demonstrate the process: Multiple Group & Filter
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:30
Joined
May 21, 2018
Messages
8,525
If the query of the subform is complex and you do not want to builld it in code as suggested, you could do the same as above and just build the filter in code which may be easier than building the whole recordsource. Either way you would remove the parameters from the original query.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 21:30
Joined
May 21, 2018
Messages
8,525
There are lots of techniques for building a filter string from multiple controls. In this thread I describe mine.
https://www.access-programmers.co.uk/forums/showthread.php?t=304424

I often have very complex filter forms with numerous controls; however, I just reuse the same techniques changes names and datatypes to work. The trick is to be flexible allowing the user the choose 1 to N controls to build a filter.
 

Users who are viewing this thread

Top Bottom