Custom ID Generator

Results 1 to 2 of 2

Thread: Custom ID Generator

  1. #1
    Join Date
    Dec 1969

    Default Custom ID Generator

    I am doing a web database using asp page. i am using MS Access to create table. I have problem of dealing with the order id. My order id is a combination of 1st letter of the month, followed by year (2 digits), then 3rd letter of current month, then followed by a suffix of 4 digits (from 0000-9999)<BR><BR>for i.e. April 2004,<BR><BR> A04R0001<BR> A04R0002 and so on.....until a new month<BR>and,<BR><BR>for every new month, the suffix will be reset to 0000 and when new record is added the suffix should become 0001. prefix remain the same format as mentioned above. <BR><BR>for i.e. M04Y0001<BR> M04Y0002 and so on...<BR><BR>i have tried to used default values in the table properties but it won&#039;t work for the suffix.<BR>(this is what i did)<BR>=Mid(MonthName(Month(Date()),True),1,1) & Format(Now(), "yy") & UCase(Mid(MonthName(Month(Date()),True),3,1))<BR>< BR>any idea how i can go about doing this so whenever i submit a new order form from my web page, the order id will be automatically generated and inserted into the new record with other order information such as customer name and etc.<BR><BR><BR>Plz help!!!!

  2. #2
    Join Date
    Dec 1969

    Default Will you do this from ASP...

    ...or directly in Access???<BR><BR>I might point out that your ID&#039;s will *NOT* sort properly.<BR><BR>For example:<BR> A04G0999<BR>will appear *before*<BR> A04R0002<BR>even though AuGust comes way after ApRil.<BR><BR>Also, JaNuary and JuNe will have the same prefix, so you will have duplicates in the table. Does that *really* make sense???<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts