Full Version: CODE Help
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Goof2767
I have the following code:

If Me.[FYStartDate] >= #6/1/2009# Then
Me.txtJobNum = Nz(DMax("JobNum", "tblDetail", "[FYStartDate]>=#6/1/2009#"), "0000") + 1

When the controll this is tied to is populated, it shows a single digit("1", "2" and so on). How can I get it to show four places i.e. "0001", "0002" and so on.
dashiellx2000
You need to set the imput mask property on the control on the form to 0000

HTH.
Goof2767
Thanks for the help!!!!
missinglinq
I believe William meant to say put the 0000 in the Format Property of the textbox, not the Input Mask.
Goof2767
Thanks missing...that worked a little better!!
JVanKirk
I think?? you could also just use:

Me.txtJobNum = Format( Nz(DMax("JobNum", "tblDetail", "[FYStartDate]>=#6/1/2009#"), "0000") + 1) , "0000")
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.