Vivirtruvian
Registered User.
- Local time
- Today, 20:30
- Joined
- Jun 20, 2017
- Messages
- 19
[SOLVED] Keep random numbers for multiple records
Hi all,
I am using a form to allow operators to scan barcodes one-by-one into our database. The operator will initially enter some text information which will be attached to the barcode's record in the table.
I am successfully using the AfterUpdate DefaultValue code to keep information stored in the relevant text boxes every time a record is updated in the main table.
Where I am running into trouble is with a randomly generated number that I need to attach to the barcodes also. Creating the number is not an issue, however I need the number that is generated on the initial opening of the form to stay the same for every scan until the form is closed again. In other words, I only want the number to be generated on opening, and not every time the form creates a new record. Unfortunately using the Defaultvalue code has no impact on keeping the random number from changing.
I understand that the random number function is there to create a random number on a record-to-record basis, but just wondering if there is any way to cheat the system a little bit?
Thanks in advance!
Hi all,
I am using a form to allow operators to scan barcodes one-by-one into our database. The operator will initially enter some text information which will be attached to the barcode's record in the table.
I am successfully using the AfterUpdate DefaultValue code to keep information stored in the relevant text boxes every time a record is updated in the main table.
Where I am running into trouble is with a randomly generated number that I need to attach to the barcodes also. Creating the number is not an issue, however I need the number that is generated on the initial opening of the form to stay the same for every scan until the form is closed again. In other words, I only want the number to be generated on opening, and not every time the form creates a new record. Unfortunately using the Defaultvalue code has no impact on keeping the random number from changing.
I understand that the random number function is there to create a random number on a record-to-record basis, but just wondering if there is any way to cheat the system a little bit?
Thanks in advance!
Last edited: