This topic is locked

Insert Random number into record field on add

10/14/2009 6:49:10 AM
ASPRunnerPro General questions
T
text author

Hi
I wonder if anyone has any suggestions. I have a table where I want to create a random token field every time a record is added.
I thought I could use the following VB script as the default value in the edit as settings of the field but it doesn't work.
Randomize (Int( (999999 - 100000 + 1) Rnd + 100000 ))
Int( (999999 - 100000 + 1)
Rnd + 100000 ) does work on its own but the same number is produced every time which is why I thought I needed to precede it with Randomize
All help gratefully received
Thanks
Richard

T
text author 10/14/2009

Hi
I solved this but thought I'd leave the solution here (please delete if not appropriate).
I used the Before Record added Event to add the random value to my field.