Most efficient way for a report with parameters? (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 19:50
Joined
Sep 21, 2011
Messages
14,046
Hi all,

We have had a few similar questions lately, namely printing a report for a particular record(s).

This thread is one such post https://www.access-programmers.co.uk/forums/showthread.php?t=303632

My question is, which is the most efficient.?

a) Put the parameter in the query that is the source for the report in some way.
b) Put the parameter in the opening of the report.

TIA
 

June7

AWF VIP
Local time
Today, 11:50
Joined
Mar 9, 2014
Messages
5,423
Mostly a matter of personal preference and comfort.

I avoid dynamic parameterized queries mostly because sometimes as developer I want to open query when referenced forms are closed.

Some parameters cannot be dynamic in query. Such as selecting multiple values from a listbox and using IN() function in criteria.
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:50
Joined
Sep 21, 2011
Messages
14,046
Hi June7,

I probably would not use the form controls for parameters of the query unless I knew it was only ever going to be used by that one form, in fact not worth taking the chance.?

I tend to use TempVars and set them from wherever.

My thinking was how does access handle the report with parameter. ? Does it open the report with all the data from the source, and then filter it, or emulate the parameter in the query. Could this even be simulated if the source is a table.?
 

June7

AWF VIP
Local time
Today, 11:50
Joined
Mar 9, 2014
Messages
5,423
Sorry, never given this any thought but I very much doubt Access loads entire table or query with option b).
 

Users who are viewing this thread

Top Bottom