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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|