input mask

RMC

Registered User.
Local time
Today, 14:05
Joined
Oct 29, 2014
Messages
11
In this DB that I am working with i have 6 different entry fields. everything works fine bu ti want to the control # to update automatically.
So the control number is "14-###". Where 14 is this year andthe ### is the variable for the control number. it was easy enough to set a control number mask but when January 1st, 2015 rolls over it will be out dated.
so how to i make a mask that has the "14" update for the year and still counts up for each new entry in the ### portion.
Thanks
/RMC
 
Put the below code in the form on load event.
Code:
Private Sub Form_Load()
  Me.YourTextcontrolName.InputMask = Format(Date, "yy-") & "###"
End Sub
 
Sorry it to so long to thank you.. Being a Military man has its downsides
Thank-you JHB
 
Ok so i gave it shot.. and the debugger comes up...
So since i am a big access dumdum
lets say my table is "table1"
my form is "form1"
the field in question is in "table1" named "auth#"

here is what i put into the code:

Private Sub Form_Load()
Me.auth#.InputMask = Format(Date, "yy-") & "###"
End Sub

Don't much about SQL but i can parrot it and then make sense of it afterwards.
 
What is the control name on the form in which "auth#" is bound to?
 
Haven't forgot about this. just no internet at work.
I'll have this data tomorrow evening.
 

Users who are viewing this thread

Back
Top Bottom