Hi,
In the air freight industry we use an Air Waybill number to ship goods, this consists of 3 numbers or letters then a separator and then 8 numbers. Most airlines these days belong to IATA who have certain rules about the way an air waybill is calculated. A number I have used is 125-58325676, the rules are that a number must always increase by 11 but cannot finish with 7, 8 or 9, when a number ends in 6 it reverts to 0, for example
125-58325676
125-58325680
125-58325691
etc.
That’s the easy part over. To test if the number is an IATA issued number you have to divide the first 7 of the last 8 by 7, what’s left over will always be the last number (number 8) for the air waybill, the sum therefore using the first number I gave 58325676 would be
58 / 7 = 8 (leaves 2) 23 / 7 = 3 (leaves 2) 22 / 7 = 3 (leaves 1) 15 / 7 = 2 (leaves 1) 16 / 7 = 2 (leaves 2) 27 / 7 = 3 (leaves 6) and as you can 6 is the indeed the last number of the air way bill. If any one can help how do I.
a. In a text box on my form make that calculation, ignoring any 4 preceding numbers or letters or dashes, i.e. 125-
b. If it doesn’t calculate right because the user input say a 5 at the end instead of a 6 would an ordinary validation rule asking ‘This is not an IATA number do you wish to continue’ YES / NO let them choose if the continue with the wrong number (I actually want them to able to continue by choice because to complicate matters not all airlines are IATA affiliated).
On a different matter has anybody noticed Woody’s frequent facts about Camels, I am getting a little concerned about life in Chiang Mei or where ever he is hanging out in Thailand.
TIA
Steve