Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine Autonumber

Status
Not open for further replies.
May 5, 2002
79
US
I have a form that uses an autonumber field for its primary key. I'd like to calculate a transaction code utilizing the autonumber field and some other parameters and assign that transaction code to a field before the user moves to a next record. Is there a way to determine the autonumber value that is going to be assigned?
 
The following will describe, in general, what the purpose of the autonumber is.


Based on what you have indicated, I don't think it would be in your best interest to try and use for the purposes indicated.

You might want to set up your own numbering convention and use it. Since this number would automatically increment by 1 each time, using it shouldn't be as difficult.

HTH

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
 
Thanks for the link and I've been there before however I have a need to the autonumber value.
 
ppkgoldengun

MPH1 is a seasoned vetern and wise to the ways of Access.

Having said that, there are several things to try...
- You can update the record, grab the generated autonumber, use it to calculate your transaction number, then edit the record to add the transaction number to the record.

- With languages that dont support autonumber, or in a more controlled enviroment, one can use a reference or control table to track all serial numbers. The reference or control table would be pretty simple, an highly controlled (all updates are done by a central update program. Ex.

ControlTbl
TransType
TransID

TransType would be a simple text field - INVOICE, JOURNAL, CHEQUE. The TransID would be the unique transaction identifier - either a serial number maintained by the system or by programming.

Richard
 
Richard,

I am sure that mph1 is wise and you are too. I've got 10 years with with and at Oracle Corp. My needs are pretty specific for this application and the use of the autonumber field. This is not the usual way I would handle things but sometimes one has no choice in the matter. Thanks to both of you for your time and suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top