Leading zeros in a text field

G

Guest

We have a text field defined as Field Size of 2. When data is entered into
the Access Table, we need it to have a leading 0 before it is actually stored
to an ODBC SQL Server Table.

For example, if I enter "4", we want it to be physically stored in the SQL
Server Database as "04".

I did put a Format on the Access field of "00", but this did not seem to work.

Can anyone please help me???

Thanks in advance.

wnfisba
 
J

Joseph Meehan

wnfisba said:
We have a text field defined as Field Size of 2. When data is entered
into the Access Table, we need it to have a leading 0 before it is
actually stored to an ODBC SQL Server Table.

For example, if I enter "4", we want it to be physically stored in
the SQL Server Database as "04".

I did put a Format on the Access field of "00", but this did not seem
to work.

Can anyone please help me???

Thanks in advance.

wnfisba

I would guess you could use the LEN Expression to verify that the length
was 2 and if not to provide a pop up to the user that it needs the leading
zero, or you could code it to add a zero before the existing text then check
again, may require a second zero. I have not tried it. You could also use
the same idea on a from or with as little modification use in in an update
query to fix existing errors.
 

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