Generating record ID numbers

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
 
B

Bas Cost Budde

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top