G
Gary.
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
I would like to have a auto purchase order number.
Thanks
You can use an Autonumber field in the underlying table. Or in the
Form_BeforeInsert you can write some VBA code to construct a number on
the fly. What code? Depends on your requirements for the PO number.
-Tom.
Microsoft Access MVP
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
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.
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.
John Their will be times the more than one person maybe entering PO's what
would you suggest