Re: 2007 Access
- From: "RASTUS" <rcuf@xxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 21:57:19 +1000
Salad,
RE:below
I have changed the field to just a plain numeric field now based on advice
that I should not use a key autonumber field to create JOB NUMBERS. What
should I put in the control source to make the number increment by one and
start at 550000.
So that every time I tab past the first field a new order number is created
but not saved until the last required field is entered, what I want to do is
raise a new job for work coming in for calibration.
"RASTUS" <rcuf@xxxxxxxxxxx> wrote in message
news:13au5t8en3fnrcc@xxxxxxxxxxxxxxxxxxxxx
Thanks salad I will read up on Dmax and see if I can work out what you are
doing there
I'm a bit of a novice with this, I have done an advanced access course but
I think they just hand those pieces of paper out like toilet paper.
Regards
"salad" <oil@xxxxxxxxxxx> wrote in message
news:e_Ari.13670$Od7.11955@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Cab man wrote:
I am constructing an order number and a Job number based database and ISub IncTo550000
want the order numbers to automatically increment to the next number, I
currently have used a combined key to achieve this but don't know how to
make both parts of the key display on the form and don't know how to
make the number increment starting from a given number say 550000, can
anyone help, possibly I should not use the key field to achieve the
desired effect?
Dim rst As Recordset
Dim lngFor As Long
Dim lngStart As Long
'this will inc the autonumber of table TEST
Set rst = CurrentDb.OpenRecordset("Test", dbOpenDynaset)
'get the current max id in the table Test (autonumber named ID)
lngStart = NZ(DMax("ID","Test"),0) + 1
'now increment the autonumber in the table
For lngFor = lngStart To 550000
rst.AddNew
Next
rst.Close
Set rst = Nothing
End Sub
.
- Follow-Ups:
- Re: 2007 Access
- From: salad
- Re: 2007 Access
- References:
- 2007 Access
- From: Cab man
- Re: 2007 Access
- From: salad
- Re: 2007 Access
- From: RASTUS
- 2007 Access
- Prev by Date: Re: 2007 Access
- Next by Date: Re: Using ADO and DAO in same mdb
- Previous by thread: Re: 2007 Access
- Next by thread: Re: 2007 Access
- Index(es):
Relevant Pages
|