C
cefrancke
I'm trying to do some optimizations on my Access DB.
After reading on table/query counts, I decided to examine all queries
and reuse common queries instead of re-creating the same query with
another name.
I have found a number of queries used in forms that could easily
(apparently) be used in a corresponding report. A good thing, of
course.
Questions:
1. Combo boxes:
I read about using defined queries instead of SQL in combo boxes
(Access compiles the query the first time the form is opened, as
opposed to compiling every time the SQL statement is used. Please
confirm)
I assume refering directly to a table, would be efficient as well, for
example in a simple combo lookup, where just the ID (bound column) and
a description field (display list) are necessary.
However, what if I want the description field to be sorted, should I
create a query just for that, or use SQL or is there a way to have the
table sort in the combo automatically on the display field?
I have many different "pick box" combos where I need the display field
sorted and this could imply that I may have to create a stored query
for each combo, if this is most efficient.
2. Reports
Is it faster to allow the report controls/code do as many calculations
as possible or let the
underlying query do all the calculations? My intuition tells me to let
the report do it if it can because the query will return filtered data
and the report will do the calculations on the smaller filtered
recordset, as opposed to the query doing calculations on all the data
and the report filtering the results. I'm assuming there is some order
to the query event, report filter event, and report calculation events.
Thanks in advance for any insight.
Christopher
After reading on table/query counts, I decided to examine all queries
and reuse common queries instead of re-creating the same query with
another name.
I have found a number of queries used in forms that could easily
(apparently) be used in a corresponding report. A good thing, of
course.
Questions:
1. Combo boxes:
I read about using defined queries instead of SQL in combo boxes
(Access compiles the query the first time the form is opened, as
opposed to compiling every time the SQL statement is used. Please
confirm)
I assume refering directly to a table, would be efficient as well, for
example in a simple combo lookup, where just the ID (bound column) and
a description field (display list) are necessary.
However, what if I want the description field to be sorted, should I
create a query just for that, or use SQL or is there a way to have the
table sort in the combo automatically on the display field?
I have many different "pick box" combos where I need the display field
sorted and this could imply that I may have to create a stored query
for each combo, if this is most efficient.
2. Reports
Is it faster to allow the report controls/code do as many calculations
as possible or let the
underlying query do all the calculations? My intuition tells me to let
the report do it if it can because the query will return filtered data
and the report will do the calculations on the smaller filtered
recordset, as opposed to the query doing calculations on all the data
and the report filtering the results. I'm assuming there is some order
to the query event, report filter event, and report calculation events.
Thanks in advance for any insight.
Christopher