Default Value Problem

Teady91

Registered User.
Local time
Tomorrow, 00:51
Joined
Jul 6, 2010
Messages
30
I am trying to fix a problem with a purchase order form. I need to have auto numbers in the item number field (which is in a sub form) but i need it to start again for each purchase order. Currently i am using:

Nz(Dmax(expression,domain),0)+1

In the Default value field. The domain is a select query that filters the item numbers based on the current purchase order record. My trouble is it always repeats the number before it ascends... I should also mention that it is in a continuous sub form. Any ideas on what im doing wrong would be greatly appreciated.
Taison.
 
Last edited:
Thank you John,
I your db helped me to do what i wanted to do.
Just to elaborate in case anyone has the same issue as me. I didnt want to have a button like in the sample that john has posted so i used the after update event on one of the other fields in my form ie description. I also set the default value of the Item field as 0. Now what happens is when you start filling in the fields the the item number is zero, until you update the description field then it it changes to the correct number in the sequence. This also allows you to enter in your own item number and it wont be affected by the auto number system. (unless you enter zero).
Hope this can help someone else.
Cheers Taison.
 

Users who are viewing this thread

Back
Top Bottom