By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

how to get rid of warnings from required fields?

P: n/a
Hi, I made a form based on one table that has several required fields.
If in the form, I leave some of them blank and close the form using
'X', I get 2 warning messages, 1st is "... field is required." 2nd is
"if you close, the data will be lost."
How can I get rid of these or, if possible, I would like to replace
them with my own. I tried Form Close event, doesn't work.
Anyone could help me here? Thanks in advance.
ming

May 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 13 May 2006 15:42:39 -0700, swingingming wrote:
Hi, I made a form based on one table that has several required fields.
If in the form, I leave some of them blank and close the form using
'X', I get 2 warning messages, 1st is "... field is required." 2nd is
"if you close, the data will be lost."
How can I get rid of these or, if possible, I would like to replace
them with my own. I tried Form Close event, doesn't work.
Anyone could help me here? Thanks in advance.
ming


Here's how you can find the correct error and show your 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 and the default error
message.

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

If DataErr = XXXX Then
Response = acDataErrContinue ' Don't display the default message
MsgBox "Please enter data in all required fields."
Else
MsgBox "Error#: " & DataErr
Response = acDataErrDisplay ' Display Default message
End If

where XXXX is the error number.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
May 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.