R
Rob
Hi all,
I have some code in the Forms Before_Update event. This code has always
worked when I use it before moving rows, but it does not work as
anticipated when I try to close a form (from the X in the ControlBox). When
I close a 'Dirty' form and select No, I am presented with the "Cant save
record at this time error". Any help would be appreciated,
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
Select Case MsgBox(strSave, vbQuestion + vbYesNoCancel, "Save Task?")
Case vbNo
Me.Undo
Cancel = True
Case vbCancel
Cancel = True
End Select
End If
End Sub
Cheers
Rob
I have some code in the Forms Before_Update event. This code has always
worked when I use it before moving rows, but it does not work as
anticipated when I try to close a form (from the X in the ControlBox). When
I close a 'Dirty' form and select No, I am presented with the "Cant save
record at this time error". Any help would be appreciated,
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
Select Case MsgBox(strSave, vbQuestion + vbYesNoCancel, "Save Task?")
Case vbNo
Me.Undo
Cancel = True
Case vbCancel
Cancel = True
End Select
End If
End Sub
Cheers
Rob