I must be missing something. I have tried all of the following syntax and all i get is a "0".
Nz(DMax("fieldname"),0)+1
Nz(DMax(Comp#),0)+1
Nz(DMax("Comp#"),0)+1
I must be missing something. I have tried all of the following syntax and all i get is a "0".
Nz(DMax("fieldname"),0)+1
Nz(DMax(Comp#),0)+1
Nz(DMax("Comp#"),0)+1
Hi
Can you upload a zipped copy of the database?
I appreciate your offer. Really do. But I hope to make this a publishable for sale project. If I can get my old head around it. So I'd prefer not to. I trust you understand.
Hi
OK No probs
The code has to go in the Before Update of the Form
Me.InvoiceNr = Nz(DMax("InvoiceNr","tblCustomerOrderdates"),0) + 1
I am assuming that the Form is based on "tblCustomerOrderdates" which contains a field named "InvoiceNr"
When you apply the above code you would need to replace InvoiceNr with your Fieldname and replace tblCustomerOrderDates with the name of your Table.
They're not deleting the primary key, just changing it from autonumber to non autonumber. But I did note my objection to the whole idea earlier.
Uncharted water.
I was trying to attach to Mike. ?? I have highlighted the field in yellow. I also need to fix that field so it is un-editable. Additionally, I would like to start it at 2001. If that is possible? Thanks Ya'll for watching over an old man. I have take collage courses 3 years ago. But one needs to keep developing to remember.
Hi Rick
See the attached
Thanks Mike IT WORKS!. The only thing is I can't find where your Syntax is to see how you did it?
Hi Rick
If you go into the Design of the Form and then follow the steps in the attached:
Da Da - Great Thanks VB is over my pay grade