Hi guys,
I just takeover to continue on a database project with a bug, the code seems all good, but it didn't pass through an execute SQL statement. Here the part of code that stucked:
The expression is trying to move any leaving staff from one table to another, both tables are linked from another access mdb. The line in bold is where the process stops, but this whole expression in previous versions did work where its exactly the same. I had suspected that its because the code was supported in Access 97 but not in Access 2003, but as the file format is compatable to both version I don't think such fact matters. So how can I fix this error? Thanks.
Colin
I just takeover to continue on a database project with a bug, the code seems all good, but it didn't pass through an execute SQL statement. Here the part of code that stucked:
Code:
If main.UserAction = main.UserSelected Then
[B]myDb.Execute "INSERT INTO ArchiveEmployees SELECT * FROM Employees WHERE ID=" & [txtID][/B]
If myDb.RecordsAffected = 1 Then
DeactiveDate = main.g_FmtDate
Comment = main.g_Str
myDb.Execute " UPDATE ArchiveEmployees SET [Date Terminated] = " & DeactiveDate & ", " & _
" Comments ='" & Comment & "'" & _
" WHERE ID = " & [txtID]
myDb.Execute " Delete * FROM Employees WHERE ID=" & [txtID]
MsgBox " Archive Success !", vbInformation + vbOKOnly, " Operation complete"
Else
MsgBox " Cannot copy records to the Archive Table", _
vbOKOnly + vbCritical, " Operation Failed"
End If
Me.Requery
Me.Refresh
End If
Colin
Comment