Input Field four digits

mr moe

Registered User.
Local time
Today, 10:41
Joined
Jul 24, 2003
Messages
332
Hi guys,
I created an input field in a form, I'm only alowing the user to input 4 numbers maximum no alpha, example 1234. How can I not let the user enter zero as the first number, example 0123. Thanks.
 
Well if the field datatype is integer then, the 0 will automatically disappear. If it's text then:
Sub txtNumber_Afterupdate()
Me.txtNumber = Cint(txtNumber)
'Me.txtNumber = Cstr(txtNumber) 'only add this line if the value must remain text data type
End Sub

HTH
Premy
 

Users who are viewing this thread

Back
Top Bottom