Hi
I have the following code in one of my forms:
The issue is, everytime I close the form, a blank vbOKOnly msg box appears with no caption or content. I am having the same issue everywhere I have used the error handler. Thanks for your guidance
I have the following code in one of my forms:
Code:
Private Sub CloseBtn_Click()
On Error GoTo Errhandler
If Not Me.Dirty Then
DoCmd.RunCommand acCmdClose
Else
Select Case MsgBox("Do you want to save changes before closing the form?", vbYesNoCancel + vbCritical + vbDefaultButton1)
Case vbYes:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdClose
Case vbCancel:
Exit Sub
Case vbNo:
Me.Undo
DoCmd.RunCommand acCmdClose
End Select
End If
Errhandler:
MsgBox Err.Description
End Sub
The issue is, everytime I close the form, a blank vbOKOnly msg box appears with no caption or content. I am having the same issue everywhere I have used the error handler. Thanks for your guidance