Using date function in access

  • Thread starter Thread starter gltoons
  • Start date Start date
G

gltoons

I am writing a "make table" query to backup an existing table. I want
the table name to reflect the current date but I do not want to have
to enter the table name everytime I run this query. Is there a way to
get access to insert the current date in a table name for you?
 
You don't really need to use a 'make table' query for this. Calling the
CopyObject method in code will do it, e.g.

DoCmd.CopyObject _
NewName:="YourTable" & Format(VBA.Date,"yyyymmdd"), _
SourceObjectType:=acTable, _
SourceObjectName:="YourTable"

using the yyyymmdd format for the date means that the new table names will
automatically sort in date order in the database window.

Ken Sheridan
Stafford, England
 

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

Back
Top