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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Custom Validation Text message



 
 
Thread Tools Display Modes
  #1  
Old May 8th, 2007, 09:55 PM posted to microsoft.public.access.tablesdbdesign
Access Joe
external usenet poster
 
Posts: 118
Default Custom Validation Text message

Hey everyone,

In my table, when a user enters a value that doesn't match my validation
requirements, it prompts them with an error message. I've customized the
'Validation Text' field so a custom message comes up.But, is it possible to
display the "current entry" on this message (the actual entry that prompted
the error)?

I.E. If a person types the number "200" in a field validated to only
accepts 100 or less, I would like the mssage to say something like: "200 does
not fall within the specific range. Please try again."

Any help would be appreciated. Thanks!
  #2  
Old May 8th, 2007, 10:14 PM posted to microsoft.public.access.tablesdbdesign
Larry Daugherty
external usenet poster
 
Posts: 1,012
Default Custom Validation Text message

Tables don't offer much in the way of user interface tools. To do
what you want, do your validation in code at the form level and use a
message box.

HTH
--
-Larry-
--

"Access Joe" wrote in message
...
Hey everyone,

In my table, when a user enters a value that doesn't match my

validation
requirements, it prompts them with an error message. I've

customized the
'Validation Text' field so a custom message comes up.But, is it

possible to
display the "current entry" on this message (the actual entry that

prompted
the error)?

I.E. If a person types the number "200" in a field validated to

only
accepts 100 or less, I would like the mssage to say something like:

"200 does
not fall within the specific range. Please try again."

Any help would be appreciated. Thanks!



  #3  
Old May 8th, 2007, 10:25 PM posted to microsoft.public.access.tablesdbdesign
Access Joe
external usenet poster
 
Posts: 118
Default Custom Validation Text message

Would you be able to tell me where and how the code would be written on the
form field?

"Larry Daugherty" wrote:

Tables don't offer much in the way of user interface tools. To do
what you want, do your validation in code at the form level and use a
message box.

HTH
--
-Larry-
--

"Access Joe" wrote in message
...
Hey everyone,

In my table, when a user enters a value that doesn't match my

validation
requirements, it prompts them with an error message. I've

customized the
'Validation Text' field so a custom message comes up.But, is it

possible to
display the "current entry" on this message (the actual entry that

prompted
the error)?

I.E. If a person types the number "200" in a field validated to

only
accepts 100 or less, I would like the mssage to say something like:

"200 does
not fall within the specific range. Please try again."

Any help would be appreciated. Thanks!




  #4  
Old May 8th, 2007, 11:27 PM posted to microsoft.public.access.tablesdbdesign
fredg
external usenet poster
 
Posts: 4,386
Default Custom Validation Text message

On Tue, 8 May 2007 14:25:01 -0700, Access Joe wrote:

Would you be able to tell me where and how the code would be written on the
form field?

"Larry Daugherty" wrote:

Tables don't offer much in the way of user interface tools. To do
what you want, do your validation in code at the form level and use a
message box.

HTH
--
-Larry-
--

"Access Joe" wrote in message
...
Hey everyone,

In my table, when a user enters a value that doesn't match my

validation
requirements, it prompts them with an error message. I've

customized the
'Validation Text' field so a custom message comes up.But, is it

possible to
display the "current entry" on this message (the actual entry that

prompted
the error)?

I.E. If a person types the number "200" in a field validated to

only
accepts 100 or less, I would like the mssage to say something like:

"200 does
not fall within the specific range. Please try again."

Any help would be appreciated. Thanks!




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.

I believe your Validation Rule error raises error # 7753
So code your form's Error event:

If DataErr = 7753 Then
MsgBox "Your entry of " & Me![YourControlName].Text & " must be
less than 100."
Else
MsgBox "Error#: " & DataErr
End If
Response = acDataErrContinue

The error message will read:
"Your entry of 200 must be less than 100."


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #5  
Old May 9th, 2007, 12:09 PM posted to microsoft.public.access.tablesdbdesign
Access Joe
external usenet poster
 
Posts: 118
Default Custom Validation Text message

That worked PERFECTLY. Thanks Fred!

"fredg" wrote:

On Tue, 8 May 2007 14:25:01 -0700, Access Joe wrote:

Would you be able to tell me where and how the code would be written on the
form field?

"Larry Daugherty" wrote:

Tables don't offer much in the way of user interface tools. To do
what you want, do your validation in code at the form level and use a
message box.

HTH
--
-Larry-
--

"Access Joe" wrote in message
...
Hey everyone,

In my table, when a user enters a value that doesn't match my
validation
requirements, it prompts them with an error message. I've
customized the
'Validation Text' field so a custom message comes up.But, is it
possible to
display the "current entry" on this message (the actual entry that
prompted
the error)?

I.E. If a person types the number "200" in a field validated to
only
accepts 100 or less, I would like the mssage to say something like:
"200 does
not fall within the specific range. Please try again."

Any help would be appreciated. Thanks!



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.

I believe your Validation Rule error raises error # 7753
So code your form's Error event:

If DataErr = 7753 Then
MsgBox "Your entry of " & Me![YourControlName].Text & " must be
less than 100."
Else
MsgBox "Error#: " & DataErr
End If
Response = acDataErrContinue

The error message will read:
"Your entry of 200 must be less than 100."


--
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


All times are GMT +1. The time now is 11:38 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.