Copy and Name Table

A

Alex

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.
 
J

John Vinson

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
 

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