D
Douglas J. Steele
OldSQL = "INSERT INTO C:\History\Old.Mdb\tblChecksTMP " & _
"SELECT * FROM tblChecks " & _
"WHERE tblChecks.BizDay <= DateAdd("yyyy", -1, Date());"
DoCmd.RunSQL OldSQL
NOOldSQL = "DELETE * FROM tblChecks " _
& "WHERE tblChecks.BizDay <= DateAdd("yyyy", -1, Date());"
DoCmd.RunSQL NOOldSQL
Personally, I prefer using
CurrentDb.Execute SQL, dbFailOnError
rather than
DoCmd.RunSQL SQL
for two reasons. The Execute method will raise a trappable error if
something goes wrong with the query, and it doesn't have the "Access is
about to...." pop-up message.
"SELECT * FROM tblChecks " & _
"WHERE tblChecks.BizDay <= DateAdd("yyyy", -1, Date());"
DoCmd.RunSQL OldSQL
NOOldSQL = "DELETE * FROM tblChecks " _
& "WHERE tblChecks.BizDay <= DateAdd("yyyy", -1, Date());"
DoCmd.RunSQL NOOldSQL
Personally, I prefer using
CurrentDb.Execute SQL, dbFailOnError
rather than
DoCmd.RunSQL SQL
for two reasons. The Execute method will raise a trappable error if
something goes wrong with the query, and it doesn't have the "Access is
about to...." pop-up message.