Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / December 2004

Tip: Looking for answers? Try searching our database.

Preceding Zeros with Concatenation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lilbomshl - 16 Dec 2004 05:05 GMT
I have 3 different fields in my table, one is a 2 digit number field, one is
a 3 digit autonumber that starts at 001, and the last is a 2 character text
field.  I need to concatenate these along with some special characters
example:  04-001-AH    to show up on my form.  My problem is I can't get the
autonumber field to show the preceding zeros in the concatenation.  I
formatted it on it's own in my table as 000 but with the concatenation it
just goes back to not showing the preceding zeros.
Duane Hookom - 16 Dec 2004 05:25 GMT
Use the format() function
 & Format([YourField],"000")

Signature

Duane Hookom
MS Access MVP

> I have 3 different fields in my table, one is a 2 digit number field, one is
> a 3 digit autonumber that starts at 001, and the last is a 2 character text
[quoted text clipped - 3 lines]
> formatted it on it's own in my table as 000 but with the concatenation it
> just goes back to not showing the preceding zeros.
lilbomshl - 20 Dec 2004 04:07 GMT
Thank you Duane!!!

> Use the format() function
>   & Format([YourField],"000")
[quoted text clipped - 9 lines]
> > formatted it on it's own in my table as 000 but with the concatenation it
> > just goes back to not showing the preceding zeros.
Allen Browne - 16 Dec 2004 05:27 GMT
Use the Format function around the number field.

The Control Source of the text box will be something like this:
   =[Field1] & Format([Field2], "\-000\-") & [Field3]

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have 3 different fields in my table, one is a 2 digit number field, one
>is
[quoted text clipped - 6 lines]
> formatted it on it's own in my table as 000 but with the concatenation it
> just goes back to not showing the preceding zeros.
lilbomshl - 20 Dec 2004 04:07 GMT
Thank you Allen!!!

> Use the Format function around the number field.
>
[quoted text clipped - 11 lines]
> > formatted it on it's own in my table as 000 but with the concatenation it
> > just goes back to not showing the preceding zeros.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.