Generate a unique reference number (1 Viewer)

htadis

Registered User.
Local time
Today, 11:33
Joined
Dec 17, 2014
Messages
61
good day !

Need to generate a unique reference number each record wise while data entering by a form. How to do this by using a command button ? After entering all fields related to the record, when click on the command button, unique reference number for that record need to be generated and save with all other data of the records. in a later event, need to recall the record by using this reference number and also need to make relation ship with some other table by using the reference number.

How can i programme this ?
 

burrina

Registered User.
Local time
Today, 01:03
Joined
May 10, 2014
Messages
972
Additionally there are samples in the Sample Database Section.
 

htadis

Registered User.
Local time
Today, 11:33
Joined
Dec 17, 2014
Messages
61
thanks !

but can we generate this when we click on a command button. if with some letters that is much better. eg XYZ/GAA021/RO001
 

plog

Banishment Pending
Local time
Today, 01:03
Joined
May 11, 2011
Messages
11,675
Sure, but why? What's so magical about this button you have in mind? Why can't the number be created as soon as the record is created?

Same question for the letters--sure, but why? If this is to make records unique, what's so special about letters? Do you have rules for how you want these letter codes generated?
 

AccessBlaster

Registered User.
Local time
Yesterday, 23:03
Joined
May 22, 2010
Messages
6,025
Depending on what this string XYZ/GAA021/RO001 represents, you may need to break this into at least 3 segments. Then join them at the time of viewing or printing. Using the after update trigger could be more handy, again depending on your needs.
 

burrina

Registered User.
Local time
Today, 01:03
Joined
May 10, 2014
Messages
972
Different ways of doing this as has been said and advised. Also as asked, do you have set rules for the syntax?
Example:
PHP:
ControlSource=[InvNo] & "-" & [ReferenceID] & "000"

Personally I use a Module with a table for my unique generated numbers.

HTH
 

Users who are viewing this thread

Top Bottom