If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
AutoNumber
I need an autonumber field to be incrimented by more than
1. I would like it incrimented by 5 on each new record. I use the autonumber to give me import order in a invoice database. If i want to add a row to the invoice i can't do so beacause the autonumbers are 1,2,3,4,5 for eg and I cant' use 1.1, 1.2,1.3. etc. How do I do this? |
#2
|
|||
|
|||
AutoNumber
"Charlie" wrote in
: I need an autonumber field to be incrimented by more than 1. I would like it incrimented by 5 on each new record. I use the autonumber to give me import order in a invoice database. If i want to add a row to the invoice i can't do so beacause the autonumbers are 1,2,3,4,5 for eg and I cant' use 1.1, 1.2,1.3. etc. "If you care what value an Autonumber has, then you probably should not be using an Autonumber" If you want to control the allocation of unique numbers you need to do it yourself in code. Try googling for "Access Custom Autonumbers" B Wishes Tim F |
#3
|
|||
|
|||
AutoNumber
On Tue, 22 Jun 2004 09:30:09 -0700, "Charlie"
wrote: I need an autonumber field to be incrimented by more than 1. I would like it incrimented by 5 on each new record. I use the autonumber to give me import order in a invoice database. If i want to add a row to the invoice i can't do so beacause the autonumbers are 1,2,3,4,5 for eg and I cant' use 1.1, 1.2,1.3. etc. How do I do this? Don't use an Autonumber field AT ALL for this purpose (it cannot be edited, for one thing, so you wouldn't be able to insert records in between existing records anyway). I'd suggest using a Form for all your data entry (table datasheets don't provide any usable events). I presume you have an invoice main table related one-to-many to a Details table? If so, on the Details subform's BeforeUpdate event, invoke the Code Builder by clicking the .... icon and put code like Private Sub Form_BeforeInsert() Me!txtLineNo = NZ(DMax("[LineNo]", "[Details]", _ "[InvoiceID] = " & Me!txtInvoiceID)) + 5 End Sub John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#4
|
|||
|
|||
AutoNumber
On my website (see sig below) is a small sample database called
"AutonumberProblem.mdb" which illustrates a solution much like John's. -- --Roger Carlson www.rogersaccesslibrary.com Reply to: Roger dot Carlson at Spectrum-Health dot Org "Charlie" wrote in message ... I need an autonumber field to be incrimented by more than 1. I would like it incrimented by 5 on each new record. I use the autonumber to give me import order in a invoice database. If i want to add a row to the invoice i can't do so beacause the autonumbers are 1,2,3,4,5 for eg and I cant' use 1.1, 1.2,1.3. etc. How do I do this? |
Thread Tools | |
Display Modes | |
|
|