I wrote the following code and it does not work. I would like to be able to copy the contents of one table to another table with the same name but with the current date appended to it. I'm getting extremely frustrated with this and I have asked other people here and no one seems to be able to help me. I originally tried to use the variable I created of "Backupfile" but that didn't work either.
Sub CreateTable()
Dim CurrentDate As Date
Dim BackupFileName As String
Dim strSql As String
Dim BackupFile As String
Dim dbs As Database
Dim qdf As QueryDef
Set dbs = CurrentDb
CurrentDate = Date
BackupFileName = "tbl_mstr_CTS_Raw_Data" & " " & CurrentDate
strSql = "SELECT tbl_MSTR_CTS_RAW_Data.* INTO tbl_mstr_CTS_Raw_Data" & " " & CurrentDate & _
"FROM tbl_MSTR_CTS_RAW_Data;"
dbs.Execute strSql
End Sub
Sub CreateTable()
Dim CurrentDate As Date
Dim BackupFileName As String
Dim strSql As String
Dim BackupFile As String
Dim dbs As Database
Dim qdf As QueryDef
Set dbs = CurrentDb
CurrentDate = Date
BackupFileName = "tbl_mstr_CTS_Raw_Data" & " " & CurrentDate
strSql = "SELECT tbl_MSTR_CTS_RAW_Data.* INTO tbl_mstr_CTS_Raw_Data" & " " & CurrentDate & _
"FROM tbl_MSTR_CTS_RAW_Data;"
dbs.Execute strSql
End Sub