P
PayeDoc
Hello All
I have a field 'ni_number' in a table which must always be 2 alphas then 6
digits then 1 alpha, and I have the validation for this in place. In fact,
however, the first 2 alphas must be from a defined set of (I think it's
around 150) allowable combinations, and the last alpha must be one of 6.
What's the best way of adding this validation? Obviously I could just have a
very long rule with 150 "Or"s, but that seems clumsy. I can think of
creating a new table [ni_valid_data], with 3 fields (say 'ni_serial' (key),
'prefix' and 'suffix') corresponding to the 2 valid datasets, and then
having a validation rule along the lines of
DCount([ni_valid_data]![ni_serial], [ni_valid_data], [prefix] =
Left(ni_number,2)) =1
.... but I don't think I could use this at table level, and in any case I
suspect there is a better way!!
Hope someone can help.
Many thanks
Leslie Isaacs
I have a field 'ni_number' in a table which must always be 2 alphas then 6
digits then 1 alpha, and I have the validation for this in place. In fact,
however, the first 2 alphas must be from a defined set of (I think it's
around 150) allowable combinations, and the last alpha must be one of 6.
What's the best way of adding this validation? Obviously I could just have a
very long rule with 150 "Or"s, but that seems clumsy. I can think of
creating a new table [ni_valid_data], with 3 fields (say 'ni_serial' (key),
'prefix' and 'suffix') corresponding to the 2 valid datasets, and then
having a validation rule along the lines of
DCount([ni_valid_data]![ni_serial], [ni_valid_data], [prefix] =
Left(ni_number,2)) =1
.... but I don't think I could use this at table level, and in any case I
suspect there is a better way!!
Hope someone can help.
Many thanks
Leslie Isaacs