473,385 Members | 2,162 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,385 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 4007
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.