Hello,
I have a Delete button in my Data Entry Form that worked until I added a new column to the QAMaster table.
The code for the Delete record button also includes copying the data from the QAMaster table and pasting it into the DeletedRecord table.
Ive noticed since yesterday that I am receiving the error message "Run-Time error '3825': SELECT* cannot be used in an INSERT INTO query when the source or destination table contains a multi-valued field".
I ensured that both the QAMaster and DeletedRecord tables have the exact same columns. Where did I go wrong?
Here is the code for the Delete Record button. The part where it errors out at is in red:
Thank you
I have a Delete button in my Data Entry Form that worked until I added a new column to the QAMaster table.
The code for the Delete record button also includes copying the data from the QAMaster table and pasting it into the DeletedRecord table.
Ive noticed since yesterday that I am receiving the error message "Run-Time error '3825': SELECT* cannot be used in an INSERT INTO query when the source or destination table contains a multi-valued field".
I ensured that both the QAMaster and DeletedRecord tables have the exact same columns. Where did I go wrong?
Here is the code for the Delete Record button. The part where it errors out at is in red:
Code:
Private Sub Delete_Record_Click()
Dim rst As Recordset
Dim strCopy, strSQL, answer As String
If IsNull(Me.txtRefID) Then
MsgBox "No Record to delete."
Else
answer = MsgBox("Are you sure you want to delete record?", vbYesNo + vbCritical + vbDefaultButton2, "Record Deleted Successfully")
If answer = vbYes Then
Call AuditChanges("txtRefID", "Delete")
strCopy = "INSERT Into DeletedRecord select QAMaster.* from QAMaster where (QAMaster.RefID = " & Me.txtRefID & ");"
strSQL = "delete * from QAMaster where RefID= " & Me.txtRefID
DoCmd.SetWarnings False
[COLOR=#ff0000][B]DoCmd.RunSQL strCopy[/B][/COLOR]
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
'Me.Requery
Forms("Data Entry").Requery
End If
End If
End Sub
Thank you