autonumber problem

  • Thread starter Thread starter xodusss
  • Start date Start date
X

xodusss

Some of my work orders are numbered when I get them, and I
enter that into my form. Is there a way to also have an
autonumber set up for the same field, so when I get one
that is not numbered, access will autonumber that field if
I don't actually enter one in myself? Please email, I
don't get much chance to check the newsgroups.
 
Some of my work orders are numbered when I get them, and I
enter that into my form. Is there a way to also have an
autonumber set up for the same field, so when I get one
that is not numbered, access will autonumber that field if
I don't actually enter one in myself?

You cannot do this with an Autonumber field. Instead, you'll need to
use VBA code to assign values to a Long Integer field. If it's a
one-user system, this can be pretty simple: in the Form's AfterInsert
event, put code like

Private Sub Form_AfterInsert
Me!txtWorkOrder = NZ(DMax("[WorkOrder]", "[WorkOrders]")) + 1
End Sub

(using your own table and fieldnames of course).
Please email, I don't get much chance to check the newsgroups.

Hm. That's odd. You're expecting us volunteers to donate our time to
answer your question, but don't find the answer important enough to
bother to come back for it. Ok... as you wish.
 
Back
Top