I need to be able to set up a form to enter Purchase Orders.
I would like to have a auto purchase order number.
Thanks
Put the following code (adapted to your database, of course I don't
know your table or fieldnames) in the BeforeInsert event of your form:
Private Sub Form_BeforeInsert(Cancel as Integer)
Me!PONumber = NZ(DMax("[PONumber]", "[Purchaseorders]")) + 1
End Sub
This will work for a one-user system but could lead to problems if
it's a shared multiuser database (two users could get the same ID if
they both have the form open at the same time). Post back if that's an
issue.