Hi Guys and Girls,
Im having trouble with some VBA i hope you can help me with:
in Summary, i have a Users_tbl (this is a list of all our employees), i have another table called ArchiveUsers_tbl (As you can imagine its a list of Employees that leave)
but i have to keep the data for upto 5yrs.
Due to the way the db is reports and queries i need have these seperate
I have already created a query for appending (AppendArchiveUsers_qry) and also Deleting(DeleteArchiveUsers_qry).
with these created i have also created a form with with a Combo box of all the employees names and a button with the following VBA code:
Private Sub Command5_Click()
Dim sAppendSql As String
Dim sDeleteSql As String
sAppendSql = "INSERT INTO ArchivedUsers_tbl.* " & _
"SELECT Users_tbl.* FROM Users_tbl " & _
"WHERE Users_tbl.UserID = " & _
Me.UserID
sDeleteSql = "DELETE Users_tbl.* " & _
"WHERE User_tbl.UserID =" & _
Me.UserID
CurrentDb.Execute sInsertSql(This is where the error is appearing)
CurrentDb.Execute sDeleteSql
End Sub
I keep getting an Error:
Run-time error '3078'
The Microsoft access database engine cannot find the input table or query". Make sure it exists and that its name is spelled correctly.
Can anyone help me as everything looks like its spelt correctly?