Sub SubEmptyPreviousWeeksData()
Dim db As DAO.Database
Dim QryDefinition As DAO.QueryDef
Dim strSql As String
On Error GoTo errorhandler
strSql = "DELETE tmptblWeeklyInvoice.* FROM tmptblWeeklyInvoice;"
Set db = OpenDatabase(CurrentProject.Path & "\MyComicShopTables.accdb")
strSql.Execute
db.Close
Set db = Nothing
QryDefinition.Close
Set qrydefintion = Nothing
Exit Sub
errorhandler:
MsgBox Err.Number & ":" & Err.Description
End Sub
|