custom autonumber

R

RyanF17

I am trying to create a fairly simple database, but I am having troube with
creating a custom autonumber field. I need to create a field called "Bid
Number" that is the primary key and has the following format: "yy000" where
"yy" is the current fiscal year (May to April, or 8 months ahead of calendar
year), and "000" is the generated/incremented number. Ex. 08123. And I need
the "000" part to automatically reset each Fiscal Year (May 1st). For
example, say a bid number on April 31st is 08158, then the first one on May
1st would be 09001. Can this be done? Thank you very much.
 
U

UpRider

Ryan, download http://www.dbtc.org/zipMDB/customAutonumber.zip
2 tables, 1 form with a little VBA. Load frmMainBid.
It adds records to tblBids with custom numbers like you want.
tblControl holds the next bid number as well as the YY, and even the fiscal
year start month.
With that info, the code has what it needs to generate the PK, YYbbb.

UpRider
 
M

Maldo

Uprider,
I would like to use the logic in this db but need to know if it will work in
a multiuser environment. What happens when you have more than one user
submitting a bid at the same time? Is the field that holds the next
bidnumber in tblControl locked until it the record is saved? And what
happens to the holding number if the user cancels the record entry?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top