S
SN
Good Morning
I was hoping someone could possibly assist.
My my after update event, my Docmd. Setwarning False, still tells me i have
deleted a record after i have set it to False.
I have turned them on and off after and before every command, but it still
happens
I was told to change the code from docmd.runsql to CurrentDb.Execute and
still it happens.
I was hoping someone could possible assit where i might be going wrong,
I was hoping someone could possibly assist.
My my after update event, my Docmd. Setwarning False, still tells me i have
deleted a record after i have set it to False.
I have turned them on and off after and before every command, but it still
happens
I was told to change the code from docmd.runsql to CurrentDb.Execute and
still it happens.
Code:
Private Sub OffLettReceived_AfterUpdate()
On Error GoTo Err_Handler
Dim stDocName As String
Dim stLinkCriteria As String
Dim iAnswer As Integer
If IsNull(Me!ID) Then stLinkCriteria = ""
stLinkCriteria = "[ID]=" & Me![ID]
If Me.OffLettReceived = -1 Then
DoCmd.SetWarnings (False)
iAnswer = MsgBox("Would like to move the record for " _
& Me.FirstName & " " & Me.Surname & " " _
& "to the Employee Table?" _
, vbCrLf & vbYesNoCancel)
DoCmd.SetWarnings (True)
If iAnswer = vbYes Then
DoCmd.SetWarnings (False)
Me.Status = "offer"
CurrentDb.Execute "INSERT INTO tblEmpInfo SELECT * FROM TblOffer " & _
" WHERE [ID] = " & Forms!frmOffer!ID, dbFailOnError
CurrentDb.Execute "DELETE * FROM TblOffer " & _
" Where [ID] = " & Forms!frmOffer!ID, dbFailOnError
Me!CurrOffer.Requery
DoCmd.SetWarnings (True)
Else
DoCmd.Beep
End If
Forms!frmOffer.Requery
DoCmd.SetWarnings True
Exit_Status_Change:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Status_Change
End If
End Sub
I was hoping someone could possible assit where i might be going wrong,