B
Bruce
I have designed a form. I would like an identifying
number appear in a text box (txtFormID). The first form
for the year is to be numbered 04-01, the second 04-02,
etc. On the form I have a text box with the default value
=Format(Date(),"yy") & "-" & Format(Nz(DMax
("[FormID]","tblMain"))+1,"00").
Behind the form (its record source) is a table (tblMain).
I need 04-01, 04-02 etc. to be stored there as [FormID].
The problem with my formula, of course, is that it only
works once. The second form gets an error in that text
box.
I am thinking about having a [Year] field and an
[Increment] field in tblMain. That way the value of
[txtFormID] (and of [FormID] in tblMain) could be a
concatenation of [Year] & "-" & [Increment]. I want to
use Nz(DMax...) as in the formula above to increment the
second part of the identifying number. How do I
accomplish this? Am I on the right track?
number appear in a text box (txtFormID). The first form
for the year is to be numbered 04-01, the second 04-02,
etc. On the form I have a text box with the default value
=Format(Date(),"yy") & "-" & Format(Nz(DMax
("[FormID]","tblMain"))+1,"00").
Behind the form (its record source) is a table (tblMain).
I need 04-01, 04-02 etc. to be stored there as [FormID].
The problem with my formula, of course, is that it only
works once. The second form gets an error in that text
box.
I am thinking about having a [Year] field and an
[Increment] field in tblMain. That way the value of
[txtFormID] (and of [FormID] in tblMain) could be a
concatenation of [Year] & "-" & [Increment]. I want to
use Nz(DMax...) as in the formula above to increment the
second part of the identifying number. How do I
accomplish this? Am I on the right track?