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

How to rename table referencing DateUpdate field

Status
Not open for further replies.

BridgestoneGal

Programmer
Apr 10, 2003
8
US
Please tell me how to rename a Table (in a way that can be run from a Macro) to incorporate the DateUpdate field.

I would ideally like to append the current Month to a table name as it is being imported.

Thanks!
 
You can do this using code
Code:
DoCmd.TransferDatabase acImport, DatabaseType, DatabaseName, acTable, SourceTable, NewTableName & Format(Date, "mmddyy")
If you absolutely need to run it from a macro then create a function in a module like this
Code:
Public Function ImportTable()
    DoCmd.TransferDatabase acImport, DatabaseType, DatabaseName, acTable, SourceTable, NewTableName & Format(Date, "mmddyy")
End Function
and then in your macro use the action "RunCode" and "ImportTable()" as the function name.


-Coco

[auto]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top