I have two identical tables, TblReturn & TblReturnVoids. On the form there is a Void button. I would like to move selected recorded from tableTblReturn to TblReturnVoids when user clicks on Void button.
I know, Void (YES/NO) is much better option but compliance wants voided records in a separate table. I made append query but don't know how to apply Where Clause to only move selected record from the form.
I followed the post in the forum (see below) and used to code, but it is giving me an error message. How can this be done?
http://www.access-programmers.co.uk/forums/showthread.php?t=183481
I know, Void (YES/NO) is much better option but compliance wants voided records in a separate table. I made append query but don't know how to apply Where Clause to only move selected record from the form.
I followed the post in the forum (see below) and used to code, but it is giving me an error message. How can this be done?
http://www.access-programmers.co.uk/forums/showthread.php?t=183481
Code:
Private Sub Command35_Click()
Dim sAppendSql As String
Dim sDeleteSql As String
sAppendSql = "INSERT INTO TblReturnVoids.* " & _
"SELECT TblReturn.* FROM TblReturn " & _
"WHERE TblReturn.ID = " & _
Me.ID
'sDeleteSql = "DELETE TblPersonData.* " & _
' "WHERE tblPersonData.YourPrimaryKey =" & _
' Me.primarykeyfield
CurrentDb.Execute sInsertSql
'CurrentDb.Execute sDeleteSql