Leading Zeros Lost in Concatenation

B

Bruce Meneghin

I'm guessing that the Figure Identifier field is a numeric field, and it has
some custom formatting to give it the leading zeros. If that is the case,
duplicate the formatting in the concatenation expression.
 
J

Jeff Boyce

Jim

In a query against the three fields, use the CStr() function to coerce the
first field into a text string. This should preserve the leading zeros.

Another recommendation: DON'T store the concatenated value. Instead, use a
query to calculate it on the fly.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

JimP

Thanks, Jeff --

I think I'm closer. I confess to being a newbie when it comes to using
functions in Access. If I misunderstood your advice below, I
apologize. I didn't have any luck with the CStr() function, but I
finally got my form to look as desired by putting the following in my
Control Source for the field: =Format([Figure Identifier],"0000000" &
[Description] & ".eps"). So far, so good.

http://s28.quicksharing.com/v/5304419/controlsource.jpg.html

The table tied to the form was imported in Access from Excel, and the
form was then built on the table. Within the table, however, this
field is not populating when adding new records. Only the initial row,
which was populated at the time of the import, still shows visible
data.

http://s28.quicksharing.com/v/8892670/TableFormView.jpg.html

FWIW, the two fields in the table do not have identical formatting in
Access -- the formatting is the way Access interpreted it upon import.

http://s28.quicksharing.com/v/4717182/Design_View_Figure_Identifier_Field.jpg.html
http://s28.quicksharing.com/v/4842418/DesignView_Figure_Identifier_Description.jpg.html

I would like the Figure Identifier Description field to populate in
the table, too, though this is perhaps not absolutely essential. What
is your advice for next steps?
 
J

Jeff Boyce

Jim

I'll suggest that you post your new questions as new questions. If you
leave them embedded "down-thread" like this, you won't get as many eyes on
them... nor as many brains!

Regards

Jeff Boyce
Microsoft Office/Access MVP

JimP said:
Thanks, Jeff --

I think I'm closer. I confess to being a newbie when it comes to using
functions in Access. If I misunderstood your advice below, I
apologize. I didn't have any luck with the CStr() function, but I
finally got my form to look as desired by putting the following in my
Control Source for the field: =Format([Figure Identifier],"0000000" &
[Description] & ".eps"). So far, so good.

http://s28.quicksharing.com/v/5304419/controlsource.jpg.html

The table tied to the form was imported in Access from Excel, and the
form was then built on the table. Within the table, however, this
field is not populating when adding new records. Only the initial row,
which was populated at the time of the import, still shows visible
data.

http://s28.quicksharing.com/v/8892670/TableFormView.jpg.html

FWIW, the two fields in the table do not have identical formatting in
Access -- the formatting is the way Access interpreted it upon import.

http://s28.quicksharing.com/v/4717182/Design_View_Figure_Identifier_Field.jpg.html
http://s28.quicksharing.com/v/4842418/DesignView_Figure_Identifier_Description.jpg.html

I would like the Figure Identifier Description field to populate in
the table, too, though this is perhaps not absolutely essential. What
is your advice for next steps?


Jim

In a query against the three fields, use the CStr() function to coerce
the
first field into a text string. This should preserve the leading zeros.

Another recommendation: DON'T store the concatenated value. Instead, use
a
query to calculate it on the fly.

Regards

Jeff Boyce
Microsoft Office/Access MVP







- Show quoted text -
 
J

JimP

Jim

I'll suggest that you post your new questions as new questions. If you
leave them embedded "down-thread" like this, you won't get as many eyes on
them... nor as many brains!

Regards

Jeff Boyce
Microsoft Office/Access MVP




Thanks, Jeff --
I think I'm closer. I confess to being a newbie when it comes to using
functions in Access. If I misunderstood your advice below, I
apologize. I didn't have any luck with the CStr() function, but I
finally got my form to look as desired by putting the following in my
Control Source for the field: =Format([Figure Identifier],"0000000" &
[Description] & ".eps"). So far, so good.

The table tied to the form was imported in Access from Excel, and the
form was then built on the table. Within the table, however, this
field is not populating when adding new records. Only the initial row,
which was populated at the time of the import, still shows visible
data.

FWIW, the two fields in the table do not have identical formatting in
Access -- the formatting is the way Access interpreted it upon import.

I would like the Figure Identifier Description field to populate in
the table, too, though this is perhaps not absolutely essential. What
is your advice for next steps?

- Show quoted text -

Good point, Jeff. Will do.
 

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