A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Referencing table data in field validation rule



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2009, 01:58 PM posted to microsoft.public.access.tablesdbdesign
toad848 via AccessMonster.com
external usenet poster
 
Posts: 7
Default Referencing table data in field validation rule

Hello,

I am using Access XP (2002) SP3. I've created a table that is to store the
details of certain shipments. Some shipments are measured in terms of pieces
shipped, whereas in other cases the shipment is measured in kilograms. This
being the case, I have one field called 'MeasurementUnit' that contains the
measurement unit (i.e. pieces or kilograms) and another called 'Quantity'
that contains the number of units shipped. I want a validation rule for
'Quantity' that disallows fractional numbers if the field 'MeasurementUnit'
for that record contains the value 'pieces'. For this, I believe that I'd
need to reference, in the validation rule, the value contained in the
MeasurementUnit field of the current record. How is this done?

I'd much appreciate any help.

Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200903/1

  #2  
Old March 18th, 2009, 02:36 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Referencing table data in field validation rule

To compare values between fields, use the validation rule of the table, not
that of a field.

Details and examples:
http://allenbrowne.com/ValidationRul...ValidationRule

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

"toad848 via AccessMonster.com" u50386@uwe wrote in message
news:9344bc675e872@uwe...

I am using Access XP (2002) SP3. I've created a table that is to store the
details of certain shipments. Some shipments are measured in terms of
pieces
shipped, whereas in other cases the shipment is measured in kilograms.
This
being the case, I have one field called 'MeasurementUnit' that contains
the
measurement unit (i.e. pieces or kilograms) and another called 'Quantity'
that contains the number of units shipped. I want a validation rule for
'Quantity' that disallows fractional numbers if the field
'MeasurementUnit'
for that record contains the value 'pieces'. For this, I believe that I'd
need to reference, in the validation rule, the value contained in the
MeasurementUnit field of the current record. How is this done?


  #3  
Old March 19th, 2009, 05:23 AM posted to microsoft.public.access.tablesdbdesign
toad848 via AccessMonster.com
external usenet poster
 
Posts: 7
Default Referencing table data in field validation rule

Thanks, Allen. I wasn't familiar with validation rules for tables. This
concept is going to help me out not just here, but elsewhere as well.

Thanks again.

Allen Browne wrote:
To compare values between fields, use the validation rule of the table, not
that of a field.

Details and examples:
http://allenbrowne.com/ValidationRul...ValidationRule

I am using Access XP (2002) SP3. I've created a table that is to store the
details of certain shipments. Some shipments are measured in terms of

[quoted text clipped - 10 lines]
need to reference, in the validation rule, the value contained in the
MeasurementUnit field of the current record. How is this done?


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.