Access 2000 Query source Table

W

WW

Using a Command Box and appropriate VB code I can readily select a
source table for a Report. How can I select a source table for a
Query? In VB code I need to msgbox in the source table name and have
this as source to the query.
 
J

John W. Vinson

Using a Command Box and appropriate VB code I can readily select a
source table for a Report. How can I select a source table for a
Query? In VB code I need to msgbox in the source table name and have
this as source to the query.

You'll actually need to construct the SQL string of the query from scratch,
concatenating the table-name variable with the rest of the query.

John W. Vinson [MVP]
 
W

WW

You'll actually need to construct the SQL string of the query from scratch,
concatenating the table-name variable with the rest of the query.

John W. Vinson [MVP]

I should have added that I then want a report to run on the query data.
 
W

WW

I should have added that I then want a report to run on thequerydata.

I have now solved this by using a table for the query that I use
DeleteObject to remove and CopyObject to replace with the required
table.

Thanks
 
J

John W. Vinson

I have now solved this by using a table for the query that I use
DeleteObject to remove and CopyObject to replace with the required
table.

Compact your database frequently, then - the space occupied by the table will
not be freed after DeleteObject. And the need to do this at all suggests that
you may have design flaws - where is the data that you're copying coming from?
If it's an Access table, you may have some alternatives (such as basing the
report on a select query).

John W. Vinson [MVP]
 
Top