Help with MS Access Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • need2know
    New Member
    • Oct 2007
    • 17

    #1

    Help with MS Access Database

    Hi Again,

    I must say i am Happy to be a part of "THE Scripts!"

    Once again I need 2 know. Is it possible to create a field in a table of a Access Database titled Customer ID that will auto number for example "5th customer for 2007" This is how i want it to display 005/07, so that will be thier "customer identification"

    I hope who ever responds, will understand exactly what i am asking.

    Yours Replies will be greatly appreciated
    need2know
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by need2know
    Hi Again,

    I must say i am Happy to be a part of "THE Scripts!"

    Once again I need 2 know. Is it possible to create a field in a table of a Access Database titled Customer ID that will auto number for example "5th customer for 2007" This is how i want it to display 005/07, so that will be thier "customer identification"

    I hope who ever responds, will understand exactly what i am asking.

    Yours Replies will be greatly appreciated
    need2know
    It is possible to generate this value, but it won't be an AutoNumber, or even a Number at all, and for now you'll manually have to Reset this value for the 1st Customer of a New Year. The value to which you are referring must be Text, and the next value in sequence can be generated by (assuming Table Name is tbtTest);
    [CODE=vb]
    Format$(Val(DLa st("[Customer ID]", "tblTest")) +1, "000") & "/" & Format$(Now(), "yy")
    [/CODE]
    NOTE: If the last [Customer ID] for 2007 was 023/07, the next autogenerated ID would be 024/07.

    Comment

    Working...