A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Incrementing journal voucher number



 
 
Thread Tools Display Modes
  #1  
Old December 9th, 2008, 12:35 AM posted to microsoft.public.access.forms
DBoyd
external usenet poster
 
Posts: 1
Default Incrementing journal voucher number

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~
  #2  
Old December 9th, 2008, 12:53 AM 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~

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.