Keeping zeros in place

Dave_cha

Registered User.
Local time
Today, 02:20
Joined
Nov 11, 2002
Messages
119
I have a 4 digit number field which I want to preceed with the current year to form a unique reference. When I combine, for example, 2003 with 0123 I'm getting 2003123. The zero has been dropped . Anyone know how I can avoid the zero being dropped?

sofar...

DIM Numfield as string
Numfield=dlookup("[Numfield]","Number table", "[Year]=" & (DatePart("yyyy", Date)))
[Forms]![Myform]![Myfield] = (DatePart("yyyy", Date)) & Numfield

[Numfield]'s formatting within the number table is '0000'

Thanks,

Dave
 
Try format

The formatting on the field is for visual only, not the way the data is stored. Try this

= (DatePart("yyyy", Date)) & Format(Numbfield, "0000")
 
Thanks Fuzzy
 

Users who are viewing this thread

Back
Top Bottom