How can I generate serial number with prefix from other field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ahmedamer
    New Member
    • Jan 2014
    • 6

    #1

    How can I generate serial number with prefix from other field

    I need a auto-number field (with formatting 00000)but with a prefix from other field.
    What is the way to achieve this? Is it possible to do this at table level?

    Thanks

    Regards
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Ahmedamer,
    Please do a search on this site, the method has been extensively covered many times.

    1) 00000 is very limited in scope and range.
    2) Will the numbers need to be reset
    3) If you do not need to ensure sequential numbers nor to ever reset the value then one can use a field with the autonumber typecast (well it's actully a "long" type cast) and then in the query create a calculated field that concatenate the field of interest with the format([autonumberfield]).
    4) If you need sequential and/or reseting type numbers
    4a) use the dmax() in the numeric field to return the last number in the series. one can restrict further and use the query to filter down by other qualifications
    4b) same concept as above; however, one would use VBA to set some checks to determine when to reset the counter.

    In all of the above several threads cover this, search on my user name and serial and/or sequential numbers or "TheSmileyCoder ", ADezii's user names... all of which will turn up threads with various code examples. (^_^)

    Comment

    Working...