Restart Numbering

renenger

Registered User.
Local time
Today, 03:15
Joined
Oct 25, 2002
Messages
117
I have a form that assigns numbers for our projects. As long as the year is different you can use the same number. Basically this is used to show how many projects we have had each year.

December 22nd starts our 2004 count. I need to have the numbers start over from one. I'm not sure how to do that. This is the code that I have in the field.

=DMax("[ProdNo]","qryAssignProdNo")+1

I have a field that says "Year" that defaults to the current year. I just changed that to default to 2004.

Any ideas????
 
You're just missing some criteria (the third parameter) in your DMax function. You need something like:
=DMax("[ProdNo]","qryAssignProdNo","[your_year_field_in_the _table]"=Me.[your_year_field_on_form])+1

What do you do if it's the very first project of the year though? What does DMax return then? I guess you'll find out.
 

Users who are viewing this thread

Back
Top Bottom