I have multiple forms that write to the same table. I want all data written to that table to be validated with the same rules. I can not find a way to apply the validation at the table level. It looks like it will have be done on a per-form basis using BeforeUpdate to call my vba.
I am running Access 2013. The validation of some fields will be based on the contents of other fields in the same record. I will need to do string manipulations along the lines of the following pseudo-code:
for field.Serial; do
if ( field.Model == "FORKLIFT" ); then
validation_good_if( (left(field.Serial, 2) == "FL") && (length(field.Serial) == 5) && (right(field.Serial, 3) isNumeric) )
endFor
for field.AssetTag; do
field.AssetTag = right("0000" & field.AssetTag, 8)
endFor
for field.Model, field.Location; do
toUpperCase
endFor
What is the best way to make sure all inserts/updates to my table undergo the same validation?