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.
> 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

Signature
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea