Hi
I have a form with required fields. When the user quits the database and hasn't filled in all required fields an error is generated, but the option to quit is still there.
If the user ignores the warning and quits that record will be lost.
The warning that is given is to long-winded for the users so they dont bother reading it.
What i want is to replace this message with my own. Is that possible?
What i have been trying to do is capture the error. This will work with any command upon which an error occurs BUT not for the quit command. Here is what i have done as follows:
Private Sub cmdclose_Click()
On Error GoTo errortrap1
DoCmd.Quit 'acQuitSaveAll
errortrap1:
If MsgBox("Some or all required fields are incomplete. Quiting will result in deleting the current record. Do you wish to proceed?", vbYesNo, "Oh Dear!!"
= 6 Then
Resume errorexit1
Else
Exit Sub
End If
errorexit1:
Application.Quit
End Sub
Any ideas anyone?
wah.
I have a form with required fields. When the user quits the database and hasn't filled in all required fields an error is generated, but the option to quit is still there.
If the user ignores the warning and quits that record will be lost.
The warning that is given is to long-winded for the users so they dont bother reading it.
What i want is to replace this message with my own. Is that possible?
What i have been trying to do is capture the error. This will work with any command upon which an error occurs BUT not for the quit command. Here is what i have done as follows:
Private Sub cmdclose_Click()
On Error GoTo errortrap1
DoCmd.Quit 'acQuitSaveAll
errortrap1:
If MsgBox("Some or all required fields are incomplete. Quiting will result in deleting the current record. Do you wish to proceed?", vbYesNo, "Oh Dear!!"
Resume errorexit1
Else
Exit Sub
End If
errorexit1:
Application.Quit
End Sub
Any ideas anyone?
wah.