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

Change File Name to Linked Database

Status
Not open for further replies.

surfbum3000

Technical User
Aug 22, 2003
156
US
I created a macro with the following parameters:

Transfer Type: Link
Database Type: Microsoft Access
Database Name: C:\LOGS\092006CALLS.MDB
Object Type: Table
Source: LoggedCalls
Destination: LoggedCalls
Structure Only: No

I run the macro using Scheduled Tasks on the first day of each month. The macro works fine, but I have to manually open the macro each month and change the .mdb file name to the next month after it runs.

Is there a way to use code to change the Database Name to the the next month? In this example, the file name needs to be changed to C:\LOGS\102006CALLS.MDB
 
Use the DoCmd.TransferDatabase method and the Format and Date functions (all in VBA).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top