Using query criteria for table name

D

Da Viking

Hello

I am running data extracts from a multisite inventory table, using the
[enter inv loc] criteria on a "make table" .
Is there a way that criteria can be used to name the output table. as I need
each table to have a unique name.

Thanks
Hans Soerlie
 
K

KARL DEWEY

It is recommended NOT to have separate tables by location but have a field
named Location for site name.
 
J

John W. Vinson

Hello

I am running data extracts from a multisite inventory table, using the
[enter inv loc] criteria on a "make table" .
Is there a way that criteria can be used to name the output table. as I need
each table to have a unique name.

Thanks
Hans Soerlie

MakeTable queries are VERY RARELY either appropriate or necessary. There is
very little that you can do with a Table which you cannot also do with a
Select Query. You can base a Form, or Report, or Export on a select query; you
can link to the query from an external database; etc.

Why do you feel that you need to store this data redundantly, storing data in
table names?
 
D

Da Viking

the reason for the multiple tables is that the customer requests inventory
reports for multiple locations, wanting each location on a separate tab in
excel, so the current incarnation of my data collection database I create a
table for each station they want to see, then copy/paste to excel.

John W. Vinson said:
Hello

I am running data extracts from a multisite inventory table, using the
[enter inv loc] criteria on a "make table" .
Is there a way that criteria can be used to name the output table. as I need
each table to have a unique name.

Thanks
Hans Soerlie

MakeTable queries are VERY RARELY either appropriate or necessary. There is
very little that you can do with a Table which you cannot also do with a
Select Query. You can base a Form, or Report, or Export on a select query; you
can link to the query from an external database; etc.

Why do you feel that you need to store this data redundantly, storing data in
table names?
 
J

John W. Vinson

the reason for the multiple tables is that the customer requests inventory
reports for multiple locations, wanting each location on a separate tab in
excel, so the current incarnation of my data collection database I create a
table for each station they want to see, then copy/paste to excel.

Well, you can simplify your life then; if you're assuming that you must have a
separate table in order to export to Excel, your assumption IS WRONG.

You can create a Select Query selecting the inventory for a location, and use
File... Export to export it to Excel; or you can write VBA code or a Macro
using the TransferSpreadsheet method to export the query to Excel; or you can
copy and paste from the select query datasheet to Excel. The table is just an
unneeded extra step.
 
Top