PC Review


Reply
Thread Tools Rate Thread

Validation rule trouble - ensuring values held in one field are less than those held in another field

 
 
Joey P
Guest
Posts: n/a
 
      7th Dec 2003
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 of my fields. I
have a table called "Product" and two of the fields included in this
table are "Cost Price" and "Retail Price". I need to create a
validation rule so that the Cost Price is always less than the Retail
Price. I have tried entering all sorts of validation rules into the
Cost Price field such as....

<Retail Price
and
<"Retail Price"

...... but i just can't seem to figure out the validation rule that
will enable me to do what i need to do. I'm not allowed to use Visual
Basic or anything so I'd be really grateful if someone could help me
to devise a simple validation rule that will solve my problem. Thanks
for all the help!

Joey P
 
Reply With Quote
 
 
 
 
rkc
Guest
Posts: n/a
 
      7th Dec 2003

"Joey P" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 of my fields. I
> have a table called "Product" and two of the fields included in this
> table are "Cost Price" and "Retail Price". I need to create a
> validation rule so that the Cost Price is always less than the Retail
> Price. I have tried entering all sorts of validation rules into the
> Cost Price field such as....
>
> <Retail Price
> and
> <"Retail Price"
>
> ..... but i just can't seem to figure out the validation rule that
> will enable me to do what i need to do. I'm not allowed to use Visual
> Basic or anything so I'd be really grateful if someone could help me
> to devise a simple validation rule that will solve my problem. Thanks
> for all the help!


You can't reference another field in a field level validation rule.
You can reference any number of fields in a record level validation rule.
You need a record level validation rule.

Type
'Validate or restrict data entry in tables'
into the answer wizard in Help.
Click on
'Define a validation rule to control when a record can be saved'




 
Reply With Quote
 
 
 
 
Bob Quintal
Guest
Posts: n/a
 
      7th Dec 2003
(E-Mail Removed) (Joey P) wrote in
news:(E-Mail Removed):

> 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 of my fields. I
> have a table called "Product" and two of the fields included in this
> table are "Cost Price" and "Retail Price". I need to create a
> validation rule so that the Cost Price is always less than the Retail
> Price. I have tried entering all sorts of validation rules into the
> Cost Price field such as....
>
> <Retail Price
> and
> <"Retail Price"
>
> ..... but i just can't seem to figure out the validation rule that
> will enable me to do what i need to do. I'm not allowed to use Visual
> Basic or anything so I'd be really grateful if someone could help me
> to devise a simple validation rule that will solve my problem. Thanks
> for all the help!
>
> Joey P
>



Since prices are currency, not strings, your second won't work.
< retail price is closer, but the space between the l and the p can
confuse access. Use < [Retail Price], or do the smart thing and rename
the field Retail_Price. Those pesky spaces can do all sorts of mayhem.

I once spent 3 days tracking down a problem with somebody's table where
they had put two (2) spaces between words in a few columns. Whith a small
proportional font, I just couldn't see the extra ones.

Good luck.

Bob Q

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to compare totals and flag those less than or more than Moz Microsoft Excel Misc 1 26th Mar 2010 05:41 PM
Excel to COUNTIF if number greater than one but less than another =?Utf-8?B?Um9vc3Rlcjg=?= Microsoft Excel Worksheet Functions 2 24th Oct 2005 10:35 PM
Delete rows that have data less than 20 items or less than value of 300 Crowbar via OfficeKB.com Microsoft Excel Programming 3 24th Oct 2005 09:33 PM
How can I count values greater than and less than certain values? =?Utf-8?B?b2xkIGdyZXkgd2hpc2tlcnM=?= Microsoft Excel Worksheet Functions 6 10th Sep 2005 02:09 PM
Ensuring unmanaged pointers held by managed classes Lev Microsoft VC .NET 7 12th May 2004 05:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 PM.