Validation Rules

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to ensure letters are entered in a particular order and to a finite number. Specifically roman numerals in the order MDCLXVI and in the number 7 M's 1D 4C's 1L 4X's 1 V & 4 I's. Is there any way of achieving this?
 
Are you sure you got the correct algorithm for writing numbers in Roman
numerals?

IIRC, IV is 4, IX is 9 and your algorithm doesn't allow this???

Try writing 1999 in Roman numerals.

HTH
Van T. Dinh
MVP (Access)



David said:
I want to ensure letters are entered in a particular order and to a finite
number. Specifically roman numerals in the order MDCLXVI and in the number 7
M's 1D 4C's 1L 4X's 1 V & 4 I's. Is there any way of achieving this?
 
Thanks
They only have to be additive, so allowing for subtraction like IX is not necessary for this particular application. If the only rule being applied is additive then 1999 becomes MDCCCCLXXXXVIIII rather than MCMXCIX. I can restrict the entry to only these letters OK I only neeed to restrict the order and number.
 
I guess you can create a "Translation" Table with the number of repeats that
you accept. Something like:

Roman DecVal MaxRepeat
M 1000 7
D 500 1
C 100 4
....

Then you can use code in the Control_BeforeUpdate Event to evaluate one
Roman numeral at a time. Ensure that the DecVal of numeral is always less
than or equal to the previous numeral. Count the number of repeats for each
numeral and ensure that the repeats is less than or equal to MaxRepeat.

--
HTH
Van T. Dinh
MVP (Access)


David said:
Thanks,
They only have to be additive, so allowing for subtraction like IX is not
necessary for this particular application. If the only rule being applied is
additive then 1999 becomes MDCCCCLXXXXVIIII rather than MCMXCIX. I can
restrict the entry to only these letters OK I only neeed to restrict the
order and number.
 
Many thanks

Table is clear enough, not sure about the necessary code. Can you help in this respect also?
 
Back
Top