By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,334 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,334 IT Pros & Developers. It's quick & easy.

Validation rule for number

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.