Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing destination of a Make Table Query

Status
Not open for further replies.

gareth001

Technical User
Feb 4, 2003
43
GB
Hi,

I've got a make table query which points to a certain location, but within VBA I want to be able to add a date/time stamp on the table name.

How can I change the new table name on the fly (I'm creating a table in a seperate database)?

I was origionally going to be using a select query and use TransferDatabase but this only gives me a link in the other database to where the table originated.

Thanks for any help in advance
Gareth
 
the change would be in your sql

SELECT Table1.field1, Now() AS [timestamp] INTO newtbl
FROM Table1;

 
Thanks, but i'm after the table name being changed as the table is created, not data.
 
Sorry I could have posted a better example.

Dim strsql As String
strsql = "SELECT test1 INTO " & "[tablename" & Date & "] FROM Table1"
CurrentDb.Execute strsql
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top