table naming

M

Mrhappy9

Does anyone know how to take contents from a form-control and use it in a
make table query as the new table name? thanks >MH
 
J

John W. Vinson/MVP

Does anyone know how to take contents from a form-control and use it in a
make table query as the new table name? thanks >MH

Well... this can be done, using some VBA code to construct the SQL of
the maketable query.

HOWEVER - it's *very rare indeed* to need to make multiple tables, and
a very bad idea in general to prompt the user to provide random,
uncontrolled tablenames.

What is the purpose of these new tables? What will be done with them
which cannot be done with a select query? The latter will let you
generate a Report, a Form, an export, pretty much anything that you
can do with a Table.
 
M

Mrhappy9

I've been away from access for a while. I hadn't thought of the export
option. This is for a bid building process where the user draws parts from
the inventory and sends it to the next dept. So the export straight to Excel
is probably the way to go. I wanted it to be named with the specific Bid
number from the form where the data is selected. I am kinda doing this onthe
fly and hadn't really thought it through all that well. Thanks for the
reply. >MH
 
J

John W. Vinson/MVP

So the export straight to Excel
is probably the way to go. I wanted it to be named with the specific Bid
number from the form where the data is selected.

The Query is the way to go then - create a query containing the fields
that you want to export (they can come from multiple tables); use

=Forms!YourFormName!BidNumber

as a criterion, and use the TransferSpreadsheet action in a macro or
in VBA code to do the export - of the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top