How do I find the last entry in a table

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

Guest

How would I find the last entry in a table then turn around an offer it up
as the default item for a msg response to add more entries.

..AddNew 'Add new record
response = InputBox("Enter the Order Number", "Order Entry")
![Order Number] = Val(response)

I have several tables and am creating an Order table with a unique order
number. Then when the next order is created, I would like to place the last
order number in the order table in to the InputBox output +1 so the user may
change or may not change.
 
Customer,

DefaultNext = DMax("[OrderNumber]","Order")+1

The easiest way to do this is just put DMax("[OrderNumber]","Order")+1
in the Default Value of the OrderNumber control on a form bound to the
Order table. The way yo8u are doing it, by getting the entry from an
InputBox, seems like an unnecessarily circuitous process.
 
Back
Top