Copy and Name Table

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

Guest

I need users to click a button that copies and pastes a current table but
that lets the user name the new table, either by typing the name in a message
box or by previously typing the name in a form. Something other than
renaming the table once it's been created.

Any ideas on how this would work is much appreciated.
 
I need users to click a button that copies and pastes a current table but
that lets the user name the new table, either by typing the name in a message
box or by previously typing the name in a form. Something other than
renaming the table once it's been created.

Any ideas on how this would work is much appreciated.

Well... the first thing to ask is, is there ANY reason to ever do
this?

MakeTable queries are *very* rarely necessary. If you want to produce
a Report, or display selected data on a Form, or export data to an
external file, it's almost always best to simply create a Query and
use it. Changing the Query into a MakeTable query and then displaying
(or printing or exporting) that table simply adds an additional step,
additional time, and bloats your database. Could you explain why this
is needed?

That said, you'll need to write VBA code to prompt the user for a
name; check for duplicate names in the database's TableDefs
collection; and then run the make-table query. If you can relieve my
anxiety in the previous paragraph I'll be (reluctantly) willing to
help with the code.

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