T
tbmarlie
Hello,
I'm trying to archive a table my moving it to another database and
then adding the current date to the end of it by using the code shown
below.
The table in the current database is "tbl_A20_AcctStatusCurrMo"
The table I would like to archive it to would be called
"AcctStatusCurrMo4-22-08"
The archive database that I would be copying it to is called "Master
Account List.mdb"
Originally I just tried definine a field as type date and then adding
it to the end of the table name, but I got compile errors so I figured
that it needed to be a string so I created a temp table that contains
a date field that is in string format. As it is right now, I get a
Compile error saying "External name not defined" There's probably an
easier way to do this.
Function Archive_Data()
Dim strDate As String
strDate = DLookup("[StringDate]",
"tbl_D10_MakeCurrentStringDateForBackup")
DoCmd.CopyObject ("L:\Master Accounts Archive.mdb"),
["AcctStatusCurrMo"&StrDate], acTable, "tbl_A20_AcctStatusCurrMo"
End Function
I'm trying to archive a table my moving it to another database and
then adding the current date to the end of it by using the code shown
below.
The table in the current database is "tbl_A20_AcctStatusCurrMo"
The table I would like to archive it to would be called
"AcctStatusCurrMo4-22-08"
The archive database that I would be copying it to is called "Master
Account List.mdb"
Originally I just tried definine a field as type date and then adding
it to the end of the table name, but I got compile errors so I figured
that it needed to be a string so I created a temp table that contains
a date field that is in string format. As it is right now, I get a
Compile error saying "External name not defined" There's probably an
easier way to do this.
Function Archive_Data()
Dim strDate As String
strDate = DLookup("[StringDate]",
"tbl_D10_MakeCurrentStringDateForBackup")
DoCmd.CopyObject ("L:\Master Accounts Archive.mdb"),
["AcctStatusCurrMo"&StrDate], acTable, "tbl_A20_AcctStatusCurrMo"
End Function