Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2004

Tip: Looking for answers? Try searching our database.

Copy and Name Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 30 Nov 2004 19:53 GMT
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.
John Vinson - 30 Nov 2004 21:13 GMT
>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.