Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    32

    Unanswered: incrementing a value in the database automatically

    Hii,

    I have one filed Proposal number in my database. Its format is Prop#/year like 001/03-04 i.e 001 is the proposal number in the year 03-04. When i add a record, the next number should be automatically generated in the same format like 002/03-04 ..... 010/03-04.

    How can I add trailing zeros in the above format?

    Thanks

    Annam

  2. #2
    Join Date
    Nov 2003
    Posts
    267
    One suggestion.

    Have a seperate table where you will store the number you are incrementing for the year.

    Whne you go to add a new record, get the current number to use from the AutoNumberTable and combine it with the current year doing the following


    PrimaryKey = Format(AutoNumberValue,"000") & "/03-04"
    (Primary key is a string)

    The increment you AutoNumberValue and update the field in the AutoNumberTable to the next available number.

    Good Luck

    S-

  3. #3
    Join Date
    Nov 2003
    Posts
    32
    Thanks a lot

    I will try doing the way you said

Posting Permissions

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