Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autogenerated numbers

Status
Not open for further replies.

mondeoman

MIS
Dec 7, 2006
203
GB
I want to be able to autgenerate a number and display it in a log. Basically a user generates a maintenance or works request. Monitoring the building is important so the record should display both a CODE for the building (e.g. Admin Offices would have a code ADM)and this would be followed by a unique auto generated number as the user would not necessarily know the next number to enter. This should display as ADM20012 and then the table should be updated with this number. Is there a way to do this please?

Mondeoman
 
Hi mond,

Simplest way is to define an 'autonumber' field in the table, and display it in a dummy field as

"ADM" & str(autonumber_fieldname).

The auto number will start at 1 however. You can either pad this out e.g. "00001", or there is way to start the autonumber at a value that suits you (I forget how).

ATB

Darrylle

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
search in htese (Tek-Tips) fora with the keyword "AutoNumber". It should (WILL) return numerous replies, many of which are along the lines of the offering ny Darrylles, and others with - perhaps more sophisticated aproaches.

You could apply this to the FAQs as well and get at least one hit with a way to do a real 'custom' value for use as your Key field.




MichaelRed


 
Thanks to both of you I will look at these options

Mondeoman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top