Suppress error messages

  • Thread starter Thread starter jokobe
  • Start date Start date
J

jokobe

Hi ng,

I have a form for data input into a table. The first table
field is a key field and has input required. If a user
is leaving the field in the form, a access message pops up,
telling something like input required.
I want to bypass this acces message and popup my own
error message.
To solve this problem, I have tried within in the form
coding:
EVENT: exit field
On error goto 0 : the help file says, this disables the
error messages, but it didn't change anything.
The second try:
EVENT: exit field

Docmd.setwarnings false

Any helpful hint out there in cyberspace???

Thanks in advance


Jokobe
 
Hi ng,

I have a form for data input into a table. The first table
field is a key field and has input required. If a user
is leaving the field in the form, a access message pops up,
telling something like input required.
I want to bypass this acces message and popup my own
error message.
To solve this problem, I have tried within in the form
coding:
EVENT: exit field
On error goto 0 : the help file says, this disables the
error messages, but it didn't change anything.
The second try:
EVENT: exit field

Docmd.setwarnings false

Any helpful hint out there in cyberspace???

Thanks in advance

Jokobe

This is a form error.

Here's how you can find the correct error and show you own message for
any of the form level errors.

First code the form's Error event:

MsgBox "Error#: " & DataErr ' Display the error number
Response = acDataErrDisplay ' Display Default message

Then open the form and intentionally make that error.

The message box will display the error number.

Next, go back to the Form error event and change that code to:

If DataErr = ???? Then
Response = acDataErrContinue ' Don't display the default message
MsgBox "Write your message here."
Else
MsgBox "Error#: " & DataErr
Response = acDataErrDisplay ' Display Default message
End If
 
Back
Top