M
Michael Rolko
In Access 2002 using Jet, I want the user to pick from a
(dynamic) list of tables (all with same column structure)
and then have ONE report dynamically run against a query
against the chosen table. I DO know how to dynamically set
the report source for the report (which is a query), but I
do not know how to dynamically set the tablename in the
FROM clause of the query underlying the report. That is, I
want the user to be able to create any number of tables
(of the same structure), and then pick one of the tables
in a form. The chosen table then dynamically gets
referenced in the underlying query. The user should not
have to manually create a query for each of the tables.
(The query is a join on the chosen table and some other
fixed tables.)
The desired architecture is:
A. 1 report uses 1 query that dynamically references the
chosen table, or
B. 1 report that uses a dynamically determined query as
record source, and that query (created in VBA) selects
from the previously created table. This approach would
require me to create a query in VBA for every table that
the user creates.
If Jet supported views, this problem would be a piece of
cake...
Maybe my approach is wrong, but any help would be
appreciated. The user insists on having multiple tables of
the same column structure, rather than having one table
contain all the data in all the tables, which would
greatly simplify things.
Thanks, Michael (Toronto)
(dynamic) list of tables (all with same column structure)
and then have ONE report dynamically run against a query
against the chosen table. I DO know how to dynamically set
the report source for the report (which is a query), but I
do not know how to dynamically set the tablename in the
FROM clause of the query underlying the report. That is, I
want the user to be able to create any number of tables
(of the same structure), and then pick one of the tables
in a form. The chosen table then dynamically gets
referenced in the underlying query. The user should not
have to manually create a query for each of the tables.
(The query is a join on the chosen table and some other
fixed tables.)
The desired architecture is:
A. 1 report uses 1 query that dynamically references the
chosen table, or
B. 1 report that uses a dynamically determined query as
record source, and that query (created in VBA) selects
from the previously created table. This approach would
require me to create a query in VBA for every table that
the user creates.
If Jet supported views, this problem would be a piece of
cake...
Maybe my approach is wrong, but any help would be
appreciated. The user insists on having multiple tables of
the same column structure, rather than having one table
contain all the data in all the tables, which would
greatly simplify things.
Thanks, Michael (Toronto)