473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Validation Rule

Hello

In a text box, I would like the user to be able to enter only a number from
0 to 100 (including decimals Ex: 24.56) so I wrote this in the Validation
Rule Propertie
of the text box : >= 0 And <=100

This works good when the user enters numbers in the text box but when
letters are entered
Access displayed a default message instead of the Validation Text message.

How would I write the Validation Rule so the exclude all letters and include
all numbers from 0 to 100
including decimals?

I am using MSAccess 2000

Thanks
G.Gerard
Nov 13 '05 #1
3 3998
On Wed, 20 Apr 2005 11:23:42 GMT, "GGerard" <gg*****@nbnet.nb.ca>
wrote:

Take a look at the InputMask property. You could use it to force the
user to enter digits only.

-Tom.
Hello

In a text box, I would like the user to be able to enter only a number from
0 to 100 (including decimals Ex: 24.56) so I wrote this in the Validation
Rule Propertie
of the text box : >= 0 And <=100

This works good when the user enters numbers in the text box but when
letters are entered
Access displayed a default message instead of the Validation Text message.

How would I write the Validation Rule so the exclude all letters and include
all numbers from 0 to 100
including decimals?

I am using MSAccess 2000

Thanks
G.Gerard


Nov 13 '05 #2
Tom,
True. Though if you want control over the message that is displayed a bit
of code in the form of a validation function which displays a message in a
message box might be a better way to go.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS"

"Tom van Stiphout" <no*************@cox.net> wrote in message
news:ra********************************@4ax.com...
On Wed, 20 Apr 2005 11:23:42 GMT, "GGerard" <gg*****@nbnet.nb.ca>
wrote:

Take a look at the InputMask property. You could use it to force the
user to enter digits only.

-Tom.
Hello

In a text box, I would like the user to be able to enter only a number
from
0 to 100 (including decimals Ex: 24.56) so I wrote this in the Validation
Rule Propertie
of the text box : >= 0 And <=100

This works good when the user enters numbers in the text box but when
letters are entered
Access displayed a default message instead of the Validation Text message.

How would I write the Validation Rule so the exclude all letters and
include
all numbers from 0 to 100
including decimals?

I am using MSAccess 2000

Thanks
G.Gerard

Nov 13 '05 #3
On Wed, 20 Apr 2005 10:53:29 -0400, "Alan Webb"
<kn*******@hotSPAMmail.com> wrote:

Alan,
True. :-)
Personally I never use the validation property, but would write my
validation code in VBA in the <control>_BeforeUpdate event.

-Tom.

Tom,
True. Though if you want control over the message that is displayed a bit
of code in the form of a validation function which displays a message in a
message box might be a better way to go.


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Doslil | last post by:
I am trying to validate the fields in my database.I have already validated the fields to check for not null.Here is what I have written for Numeric and text field. Private Function EENUM() On...
2
by: Joey P | last post by:
Hi all, I am doing a project for university whereby i have to implement a simple database related to a frozen foods company. I am having some trouble though creating a validation rule for one...
7
by: Mathew Hill | last post by:
I am a beginner to the more technical aspects of Microsoft Access (2000) and was wondering if any one can help? I have a field in a table called: ADMIN NUMBER This field should have 4...
6
by: Chuck | last post by:
A97. A database has a table: tblA which has a single text field, B. It is a primary field, indexed and no duplicates. It is used as a lookup for table tblC. A form based on tblA is used to add...
4
by: ron | last post by:
I have a access based guest book. I want to create a validation rule to block certain words or parts of a srting. How do i do this? ie: this is a nice site. come visit my porn site at www.abc.zy...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
6
by: bluray | last post by:
Hello all, and thanks for taking the time to help me out here. Basically, I am trying to set up a validation rule that correlates with an input mask where the user is required to enter select...
7
by: sharsy | last post by:
Hi guys, I would like to setup a validation rule for a database in microsoft access that restricts data entry so that a certain field can only be filled in if another field has a specific answer...
1
by: MLH | last post by:
Anyone remember if A97 append query failure would ever report data breaking validation rule when such was not the case. I have an old SQL statement - several years old now. I've encountered a case...
18
by: ChipR | last post by:
I have a text box with a validation rule and validation text. When entering a new record, if I put in invalid text, the validation text is displayed in a message box, but after clicking OK, another...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.