Hi,
I'm trying to retieve the ID of the most recent invoice i have created in my Invoices table. The form i'm working from does not have its record source set to the invoices table and this can't change.
I was thinking of using the following code
Dim invid As Integer
invid = DLookup("[InvoiceID]","Invoices","Max[InvoiceID]"
However after trying something similar in a test database i found that it didn't work.
All i need is a way of getting the highest value of InvoiceID into an integer.
Please help
I'm trying to retieve the ID of the most recent invoice i have created in my Invoices table. The form i'm working from does not have its record source set to the invoices table and this can't change.
I was thinking of using the following code
Dim invid As Integer
invid = DLookup("[InvoiceID]","Invoices","Max[InvoiceID]"
However after trying something similar in a test database i found that it didn't work.
All i need is a way of getting the highest value of InvoiceID into an integer.
Please help