Results 1 to 6 of 6

Thread: Autonumer Invoice and Check Register Question

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381
    I am about to start a VB6 project for our denominational headquarters. Among other things, it will keep records such as invoices and checks.

    One of the requirements is that checks and invoices auto number with the first four digits being the current year, such as 2000-0001, 2000-0002, ect. They also want it to be able to automatically reset when the calendar roles over to a new year so that the first check or invoice of next year would be 2001-0001 and so forth.

    A third requested area as an option in this area would be to be able to manually overide a check or invoice number so that if the last invoice was 2000-0139 and you manually overrode the next invoice with 2000-0170, the next automatic invoice would become 2000-0171.

    Can anyone help get me started here with a good example with comments or point me in the right direction?

    Thanks,
    Rev. Michael L. Burns

  2. #2
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    How can you add different rules to an autonumber as I thought that's what they are automatic. I know I tried to just do an update on records w/ an autonumber (using databound controls) and I could not. I had to make it an integer and set the rules up in code.

    I'd like to see how this gets worked

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381
    I agree. That's why I'm at a loss at how to get started if it can even be done. The first two parts of my question are what they really want. The third part was a lat minute addition to their wish list, one of those, "it would also be nice" things.

    Rev. Michael L. burns

  4. #4
    Lively Member
    Join Date
    Mar 2000
    Location
    Germany
    Posts
    84

    Arrow how about using a string to store the number?

    I've been thinking about you problem a little bit ....
    I think the check-number would be best stored in a string:

    1.)
    to get the year you can use the function
    string_1 = Year(Now)

    2.)
    I would store the current number in a table or file
    like, if the last check was 2000-0023, the number stored would be 0023

    3.)
    when adding a new check
    get the stored number and add 1
    new_number=stored_number + 1

    4.)
    update the stored number in your table/file
    ... set it to 24

    5.)
    add it together and store it in you database
    checknumber= string_1 & "-" & new_number


    It shouldn't be a problem to make a little tool with which you can increase the stored number


  5. #5
    Guest
    Since I think you're talking about using an Access database, I would do the following:

    ->Set up the database column as a string
    ->Set the .defaultvalue property for the column to the first check no
    ->In your app, open the table as a TableDef
    Loop:
    ->Add a new check
    ->increment the right(.defaultvalue, 4) by one and store in .defaultvalue
    ->if overide number, set .defaultvalue to new number
    End Loop

    If you do it this way, the .defaultvalue property will conveniently keep track of the number of the next check for you, even after you close your app.

    Hope this helps, Feel free to email me for clarification.
    mailto:[email protected]
    -John

    [Edited by RoyceWindsor1 on 05-03-2000 at 10:47 AM]

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381

    Smile Reply to post 'Autonumer Invoice and Check Register Question'

    Nina and Royce,

    Thanks for your swift replies. You have given me some good food for thought.

    Rev. Michael L. Burns

Posting Permissions

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



Click Here to Expand Forum to Full Width