View Single Post
  #2  
Old December 8th, 2008, 11:53 PM posted to microsoft.public.access.forms
Dorian
external usenet poster
 
Posts: 542
Default Incrementing journal voucher number

You will need to get the 4-digit last number assigned from the table using
the DMAX function (look in Access HELP).
While you are in Help, read up on the DatePart function.

Then you create the number with:
JV = "JV" & right$("00" & DatePart("m",date()),2) & "TP" &
right$(DatePart("yyyy",date()),2) & Right$("0000" & CStr(LastNumber +1),4)

I'm assuming all numbers must be left zero-filled.

-Dorian

"DBoyd" wrote:

I creating a form that will need a field that will have a JV field that needs
to increment when a new record is created. The field is 12 characters long
with the last four digits incrementing, JV12TP09_ _ _ _. The JV and TP are
always the same the 12 is the current month and 09 is the calendar year. Can
anyone help me in creating such a number on a form. Thanks!! Using Access
2003.
--
Di~