Use only year portion of date for Unique ID

sepefrio

New member
Local time
Today, 13:54
Joined
Jun 20, 2013
Messages
9
Good Monring all, trying to get something working on a form. When creating a new client, due to privacy, we have to create a Unique ID for each one. The ID consists of their initials, the year, a serial number and the location. I have it mostly working except for the year. Let me show you what I have and the results, then what I would like the results to be.


In the control Source of the text box is:
=Left([FName],1) & "" & Left([LName],1) & "-" & [Forms]![frm_20_Enter_New_Client_Info_01]![NICN_Date] & "-" & [Forms]![frm_20_Enter_New_Client_Info_01]![NICN_Serial] & "-" & [Forms]![frm_20_Enter_New_Client_Info_01]![Combo1]


Form Input:
FName = John
LName = Smith
Date = 2014 (Using Date format and 'YYYY') and default Now()
Combo1 = NW


Results: JS-4/2/2014 9:32:51-18-NW

Desired Results: JS-2014-18-NW

So everything is working but I'm getting the entire and I just want the year. Thanks in advance for the help.
 
Try Year([Forms]![frm_20_Enter_New_Client_Info_01]![NICN_Date])
 
Wow, I feel so dumb, thanks bud, that works great.
 
No problem, even though you set it to display just the year it still stores the entire date.
 

Users who are viewing this thread

Back
Top Bottom