On Close Code for character length

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to create an on close Visual Basic code that creates a string that
determines a predetermined character length (ten characters) and populates
the field with leading zeros if it is less than ten characters. I am pretty
new to Visual Basic so need some help with a simple code to produce this
string.
 
Did you read the responses to your other post?

I assume this means that you have changed this field to a text field? If
not, adding zeros before updating the table will not make any difference.

If you have left this as a number field, did you set the "format" as
directed in the previous posts?
 
I need to create an on close Visual Basic code that creates a string that
determines a predetermined character length (ten characters) and populates
the field with leading zeros if it is less than ten characters. I am pretty
new to Visual Basic so need some help with a simple code to produce this
string.

To pad out a string with leading zeros:
= string(10-len("ABC"),"0") & "ABC"
 
I did see your previous message but because of the database i'm connecting my
database with, i need to keep it as a text field. so now i need to make an
 
Back
Top