Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Walnut Cove, NC
    Posts
    101

    Unanswered: Leading Zeros in an Auto Number field

    I have an Auto Number field that is the primary key called ESR_NO.

    I have set the format to 0000 and it puts leading zeros in every time a new record is added.

    I have a Log_No field that I concatenate the last 2 digits of a date field + "-" + ESR_NO

    This worked great for numbers 0 to 9, my Log_No looked like this:

    04-0001
    04-0002
    04-0003 etc.

    When the ESR_No reached 10 the leading zeros disappeared in the concatenation of the fields and the dash, but the leading zeros are in the AutoNumber ESR_No field. I have spent several hours trying to figure this one out, anyone have a solution????

    Thanks,

    SBR

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Leading Zeros in an Auto Number field

    Originally posted by sbr7770
    I have an Auto Number field that is the primary key called ESR_NO.

    I have set the format to 0000 and it puts leading zeros in every time a new record is added.

    I have a Log_No field that I concatenate the last 2 digits of a date field + "-" + ESR_NO

    This worked great for numbers 0 to 9, my Log_No looked like this:

    04-0001
    04-0002
    04-0003 etc.

    When the ESR_No reached 10 the leading zeros disappeared in the concatenation of the fields and the dash, but the leading zeros are in the AutoNumber ESR_No field. I have spent several hours trying to figure this one out, anyone have a solution????

    Thanks,

    SBR
    What I prefer to do is to format the data at time of entry instead of in the table structure ... In your instance I'd do something like you did except:

    LogField=Format(Now,"yy") & "-" & Format(ESR_No,"0000")

Posting Permissions

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