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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables In Table Names 1

Status
Not open for further replies.

JHHPavel

Technical User
Jul 18, 2003
29
US
I have a MicroSoft Access database which generates tables which are exported as text files for input to our accounts payable system each week. I'd like to put the current date into the name of the tables and files so that I can keep copies of what's sent, instead of covering up last week's file with this week's file because they both have the same name.

When I run the make-table query to generate the weekly table, I'd like it to name the table "AP_export_7/18/003", showing the date it was created. I've tried naming the table created AP_export_$now()$, AP_export_#now()#, etc., but nothing I've tried gives the date instead of the symbols.

Any help will be greatly appreciated.
 
You'd have to do this in VBA...the line would be something like this:

docmd.runsql ("INSERT INTO [AP_export_" & date() & "] ...and then the rest of your query (just pull the sql from the query you've already created if you need to). Hope that helps.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top