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

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

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,
 
If Not Left(Me.txtYourControl,1) = "0" Then
Me.Me.txtYourControl = "0" & Me.txtYourControl
End If
 
Back
Top