NEED TO AUTO INCREMENT FILE NAMES WHILE SAVING TABLES IN A MACRO
Posted on 2004-08-24
Hi. I am trying to find a way to Auto Increment or use the Current date when saving or copying tables in an Access Macro.
I have a macro that does the following:
1.) COPY OBJECT:
a.) Destination Database: _____blank________
b.) New Name: Results Copy
c.) Source Object Type: Table
d.) Source Object Name: MEETING RESULTS
2.) DELETE OBJECT:
a:) Object Type: Table
b.) Object Name: MEETING RESULTS
a:) Query Name: LAPTOP DATA QUERY
B.) View: Datasheet
c.) Read Only
*********This query is a Make Table query that creates a table named: Meeting Results. I want this table saved with a unique name if possible, or renamed prior to the DELETE OBJECT step in the Macro. The Copy Object name "Results Copy" was created so I would not lose the previous results, but I want to retain ALL previous Results... I would love for the file name to be: Meeting Results XXYYZZ, where XX is the Month, YY is the Day, and ZZ is the two digit year. If this isn't possible, it could simply be Meeting Results01, 02, 03, etc..
Of importance however, is that I run a report based on the "Meeting Results" table generated in the Make Table Query. The final step of the Macro is to Generate the report, so I need to be sure that the OpenReport statement will point to the most recent Table..
Thanks!!!! The faster the better!!