|
-
May 2nd, 2000, 12:15 PM
#1
Thread Starter
Hyperactive Member
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
-
May 2nd, 2000, 12:27 PM
#2
Addicted Member
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
-
May 2nd, 2000, 12:38 PM
#3
Thread Starter
Hyperactive Member
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
-
May 2nd, 2000, 09:32 PM
#4
Lively Member
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
-
May 2nd, 2000, 09:46 PM
#5
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]
-
May 2nd, 2000, 11:54 PM
#6
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|