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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Text in middle of concatenated values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CW - 14 Jan 2008 12:08 GMT
On my shipping invoices, which are reports,  I'm trying to display a line
that shows the following line: From Origin to Destination (Origin and
Destination being fields in the source query)
As the length of the Origin town varies I don't want to use fixed fields for
each value as this would either leave ugly gaps or the data would overwrite
each other.
So I have tried to concatenate everything in one textbox, with the word "to"
sandwiched in the middle. This is what I have tried:
=[Origin] & " " & to & " " & [Destination]
(I also tried it with extra quotes around "to" but then it printed it
exactly like that, showing the quotes).
Depending on what I do with the the position of the spaces and the
ampersands, I either get an incorrect syntax message or Access thinks that
the word to is a parameter and throws square brackets around it and asks me
for input when I run the report.
Where am I going wrong?
Many thanks
CW
BruceM - 14 Jan 2008 12:35 GMT
No need to treat the spaces differently than any other text.  A space can be
included at the beginning or end of a text string just as it can be included
between words within a text string.

="From " & [Origin] & " to " & [Destination]
> On my shipping invoices, which are reports,  I'm trying to display a line
> that shows the following line: From Origin to Destination (Origin and
[quoted text clipped - 18 lines]
> Many thanks
> CW
Dale Fye - 14 Jan 2008 13:26 GMT
Have you tried:

=[Origin] & " to " & [Destination]

HTH
Dale
Signature

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> On my shipping invoices, which are reports,  I'm trying to display a line
> that shows the following line: From Origin to Destination (Origin and
[quoted text clipped - 14 lines]
> Many thanks
> CW
CW - 14 Jan 2008 16:39 GMT
That did it perfectly! Many thanks Dale!
CW

> Have you tried:
>
[quoted text clipped - 21 lines]
> > Many thanks
> > CW
 
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



©2009 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.