473,387 Members | 1,493 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,387 software developers and data experts.

Validation rule for number

What is the proper way to set up a validation rule to only allow
numbers? I want to allow both 1024 and 1024.25

Nov 13 '05 #1
3 5766
Open the table in design view.

In the upper pane, set the Field Type to Number.
In the lower number, set the Field Size to Double.

Now Access will only accept numbers into the field.
The Double accepts fractional values, where the Integer sizes do not.

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

<td*******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
What is the proper way to set up a validation rule to only allow
numbers? I want to allow both 1024 and 1024.25

Nov 13 '05 #2
I forgot to mention that I am using a SQL linked table.

I have the value set to varchar in sql as I dont do any math on the
numbers and I dont like the sql error messages.

So I need to validate before update.

Is there a good validation that i can run to test for numbers?

I need to
If Not Me.amount_of_loss ???? then
MsgBox "Value entered must be a number"
Cancel=true
End If

Allen Browne wrote:
Open the table in design view.

In the upper pane, set the Field Type to Number.
In the lower number, set the Field Size to Double.

Now Access will only accept numbers into the field.
The Double accepts fractional values, where the Integer sizes do not.

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

<td*******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
What is the proper way to set up a validation rule to only allow
numbers? I want to allow both 1024 and 1024.25


Nov 13 '05 #3
If you want to do it in code, try the IsNumeric() function.

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

<td*******@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I forgot to mention that I am using a SQL linked table.

I have the value set to varchar in sql as I dont do any math on the
numbers and I dont like the sql error messages.

So I need to validate before update.

Is there a good validation that i can run to test for numbers?

I need to
If Not Me.amount_of_loss ???? then
MsgBox "Value entered must be a number"
Cancel=true
End If

Allen Browne wrote:
Open the table in design view.

In the upper pane, set the Field Type to Number.
In the lower number, set the Field Size to Double.

Now Access will only accept numbers into the field.
The Double accepts fractional values, where the Integer sizes do not.

<td*******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
> What is the proper way to set up a validation rule to only allow
> numbers? I want to allow both 1024 and 1024.25

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: Michael R | last post by:
I haven't found anything that would help me to understand the correct syntax for having a certain number of digits phone number validation rule. My input mask for this field is: \000\-0000000;;...
2
by: voroojak | last post by:
Hi i just want the user can enter number not any thing else in form. i tried >like "*#*"< in validation validation rule area and it seems that it is working and put just >accept number< in...
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...
7
by: sesling | last post by:
I have a form that has several text boxes where the operator can enter data. I want to place some validation rules around what the operator can enter. In one box I want the number to be at least...
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...
8
by: preeny8 | last post by:
Hi guys, So I'm editing an existing database (Access 2003), and I need a bit of help in making a validation rule. My table has many fields, 3 of which are indexed (location, number & revision) ...
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.