Leading Zeros Lost in Concatenation

  • Thread starter Thread starter JimP
  • Start date Start date
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.
 
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
 
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

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 -
 
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.
 
Back
Top