Generating record ID numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an orders form based on a query of two tables. The form is similar to
the Northwind orders form. I want to generate an orderID number by counting
the record in one of the underlying tables and incrementing it by one. The
number msut appear in the control on the form and be saved as the orderID
(recordID) in the underlying table.
Thanks in advance for any help
 
in the beforeInsert event:

yourcontrolname = 1 + nz(dmax("orderID","yourTableYouDidntName"),0)

I suggest you make the control both locked and disabled. That is, I
assume the user shouldn't change this number.
 
Back
Top