On Close Code for character length

D

Decembersonata

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.
 
R

Rick B

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?
 
F

fredg

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"
 
D

Decembersonata

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top