By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,574 Members | 2,966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,574 IT Pros & Developers. It's quick & easy.

Check the first character if its not zero then insert otherwise not

P: n/a
Can any one please help me how to i check the first character in a
variable. If user dont put 0 in the start of a variable the program
automatically insert zero before the number otherwise not.

mynumber=1234-6565-75 of type text

will be
mynumber=01234-6565-75

Thanks,

Sep 5 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
co*********@gmail.com wrote:
Can any one please help me how to i check the first character in a
variable. If user dont put 0 in the start of a variable the program
automatically insert zero before the number otherwise not.

mynumber=1234-6565-75 of type text

will be
mynumber=01234-6565-75

Thanks,
In the AfterUpdate event of the field, do something like
If Left(Me.FieldName,1) <"0" THen
Me.FieldName = "0" & Me.FieldName
Endif

You could also use an input mask. Open up the property sheet and go to
the Data tab. Click on Input mask and press the F1 key.

Sep 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.