Newbies Farlau Posted August 17, 2003 Newbies Posted August 17, 2003 Hi there, I have a question about auto-fill funtion!! I have two fields 1.(Order NO:) 2.(Services Date:) I want to auto-fill the number buy date. The problem is i want to auto-fill is by Services Date, not creation date!! Exp:Today is 2003/08/18 I add a new order, the services date is 2003/08/30. So the Order No will be 20030830-001 ,and then i add another record,the services date is 2003/08/30 again , so the Order No will be 20030830-002. And then I add a new record again the services date is 2003/09/28, so the Order No is 20030928-001. When I next day to add a record, the services date is 2003/08/30, i want the Order No: is 20030830-003 (because in 2003/08/30 I already have 3 order) Can I do it?::)
ernst Posted August 17, 2003 Posted August 17, 2003 Farlau said:.......Can I do it? You probably can, but think think twice if it is really necessary. The point is that the dat field is already available, so why repeat it in you order number? An order number is a kind of serial number and in principle it is a bad idea to have 'meaningful' serial numbers. Have a look in the articles section of the forum to find out why... But if you really want this you could define a self relation with date as key field on both sides of the relation and use the count function. Make the ordernumber auto-enter the following calculation: date & "-" & 1 + Count(Self::Date) You may need to fiddle with this calculation to get the leadin zero's though. Regards, Ernst.
Recommended Posts
This topic is 7871 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now