473,465 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4011
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: 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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.