Hi
I need to assign sequential invoice numbers to orders starting from the last
highest number + 1. I have tried the following code;
UPDATE Orders SET Orders.[Invoice No] = DMax("[Invoice No]","Orders") +1
WHERE Orders.[Invoice No]) Is Null AND ...
The problem is that all orders get the same number which is the last highest
number + 1. Apparently the query does not recalculate DMax("[Invoice
No]","Orders") +1 for each record and instead only gets the value once in the
beginning and assigns this same value to all the records. How can I make it
work?
Thanks
Regards
I need to assign sequential invoice numbers to orders starting from the last
highest number + 1. I have tried the following code;
UPDATE Orders SET Orders.[Invoice No] = DMax("[Invoice No]","Orders") +1
WHERE Orders.[Invoice No]) Is Null AND ...
The problem is that all orders get the same number which is the last highest
number + 1. Apparently the query does not recalculate DMax("[Invoice
No]","Orders") +1 for each record and instead only gets the value once in the
beginning and assigns this same value to all the records. How can I make it
work?
Thanks
Regards
Comment