A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

customize error messages



 
 
Thread Tools Display Modes
  #1  
Old February 6th, 2006, 08:45 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default customize error messages

How do I customize error messages for data input on forms (without code).
fields have validation, I would like to write my own error messages. (I know
how to use the validation rule/text property.)
thank you
  #2  
Old February 6th, 2006, 08:54 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default customize error messages

Hi Deborah.

Since you are not talking about the validation rule/text, I presume you are
talking about the engine-level messages such as "The value is not
apprpriate...", or "Required...", or "... would be a duplicate..."

You need to use the Error event of the form to trap these errors.
Unfortunately this does mean you need to use code. If you use a macro you
will not know which error occurred, and so you would be limited to an
extremely generic msgbox that said basically, "Oops: that didn't work, but I
can't tell you why."

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Deborah" wrote in message
...
How do I customize error messages for data input on forms (without code).
fields have validation, I would like to write my own error messages. (I
know
how to use the validation rule/text property.)
thank you



  #3  
Old February 6th, 2006, 05:14 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default customize error messages

On Mon, 6 Feb 2006 00:45:28 -0800, Deborah wrote:

How do I customize error messages for data input on forms (without code).
fields have validation, I would like to write my own error messages. (I know
how to use the validation rule/text property.)
thank you


Without Code? You can't.
With Code... it's quite easy.

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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
disable customize option when right click on menu bar areddy General Discussion 0 October 20th, 2005 09:14 AM
Customize the Places Bar (Common Dialogs) in Office XP SeaMaid General Discussions 1 October 15th, 2005 01:32 AM
Customize Toolbar Immediate Reset NoExpert General Discussion 5 September 19th, 2005 03:50 PM
help: insert symbol and tools customize not working properly greg General Discussion 2 August 28th, 2005 07:54 AM
Error Message when trying to customize font in Mail Contacts and N Ric Lager General Discussion 0 September 27th, 2004 09:27 PM


All times are GMT +1. The time now is 11:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.