All, using access 2010. I have this code below to open backend and renaming a tbl with the current date. Ex. tblMstr to tblMstr20140922. This is so a table with the same name can be imported. tblMstr. This works great. My problem is when users have to reimport the same day they get something like “tblMstr20140922 already exist.” How do I fix this? If the same date already exist; I need it to override or something. Anyone have any suggestions to fix this please?
Code:
Dim dbBackend As DAO.Database
Dim strBackendDatabase As String
strBackendDatabase = "C:\TestFolder\Sampledb.accdb"
Set dbBackend = OpenDatabase(strBackendDatabase)
dbBackend.TableDefs("tblMstr").Name = "tblMstr" & Format(Date, "yyyymmdd")
dbBackend.Close
Set dbBackend = Nothing