Name table w/ site name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Created a make table query. The query will prompt me to enter a site number
and create a table file. I would like name the same output file name w/ the
site number at the end e.g. tblPreID becomes tblPreID025 or tblPreID001. Is
there a way I can automate the process.

Thanks,
Siew-Ming
 
Hi,

Created a make table query. The query will prompt me to enter a site number
and create a table file. I would like name the same output file name w/ the
site number at the end e.g. tblPreID becomes tblPreID025 or tblPreID001. Is
there a way I can automate the process.

Only with VBA code to construct the MakeTable query on the fly.

Note that storing data in tablenames is *VERY* bad design, and should
be avoided if at all possible. If you want to create a Report, a Form,
an Export, or almost anything else for Site 025, simply create a
Select Query with the site as a parameter. Copying the data
redundantly into a table wastes time, bloats your database, and serves
no useful purpose!


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Sorry for not making my scenario clear enough. The make table query
contains parameter for site number. The input file is big gigantic table
contains all site information. Each time I run the query, it will prompt me
to enter a site number and create a table w/ info pertains to the site only.
I would like the table has the site number in its name to identify the table
for each site.

I guess I need to use VBA to accomplish the job then.

Thanks.
 
Sorry for not making my scenario clear enough. The make table query
contains parameter for site number. The input file is big gigantic table
contains all site information. Each time I run the query, it will prompt me
to enter a site number and create a table w/ info pertains to the site only.
I would like the table has the site number in its name to identify the table
for each site.

I guess I need to use VBA to accomplish the job then.

What's your definition of "big gigantic"? If it's less than, say, five
million rows, and if you have a nonunique Index on the Site field, it
would still be very much preferable to use Queries to select the
records for each individual site. Storing data in tablenames is an
absolute LAST RESORT when you have conclusively demonstrated that it's
impossible to work productively using correct methods. If you have
demonstrated that - empirically, by testing, rather than by assuming
"Access can't possibly use this big a table" - then yes, you'll need
to build the SQL in code, or use the CreateTable DAO method to create
the tables as needed.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top