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 / Forms Programming / June 2006

Tip: Looking for answers? Try searching our database.

Concatenating strings in a report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
twen - 20 Jun 2006 15:26 GMT
I am pretty new and I would like to concatenate two strings in an Access
report with some text in between. Would it go: [Field1] & "Text" & [Field2]
in the control source for a text box? It does not seem to work and I was just
wondering if I was doing something wrong?
Ed - 20 Jun 2006 15:33 GMT
try using equal sign first:
=[Field1] & "Text" & [Field2]

>I am pretty new and I would like to concatenate two strings in an Access
> report with some text in between. Would it go: [Field1] & "Text" &
> [Field2]
> in the control source for a text box? It does not seem to work and I was
> just
> wondering if I was doing something wrong?
Allen Browne - 20 Jun 2006 15:33 GMT
That looks fine, as long as you include the equal sign at the start, i.e.:
   =[Field1] & " Text " & [Field2]

Make sure the Name of this text box is not the same as the name of any
fields. For example, it must not be called Field1 or Field2 if you have
those fields.

In some circumstances, the concatenation doesn't work unless you also put
text boxes on the report for Field1 and Field2. You can set their Visible
property to No so they don't show.

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 am pretty new and I would like to concatenate two strings in an Access
> report with some text in between. Would it go: [Field1] & "Text" &
> [Field2]
> in the control source for a text box? It does not seem to work and I was
> just
> wondering if I was doing something wrong?
twen - 20 Jun 2006 15:57 GMT
Awesome thanks guys, also I was wonderin if either of you knew if I could do
calculations in a text box? Because I have to convert a decimal to a percent
and I wondered if I should just do it in the box or somewhere else?

> That looks fine, as long as you include the equal sign at the start, i.e.:
>     =[Field1] & " Text " & [Field2]
[quoted text clipped - 13 lines]
> > just
> > wondering if I was doing something wrong?
Allen Browne - 20 Jun 2006 16:07 GMT
Sure. Set the Control Source to:
   =[Field1] / [Field2]
and set the Format property of the text box to:
   Percent

Dividing by zero generates an error, so you might want to use:
   =IIf([Field2]=0, Null, [Field1] / [Field2])

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.

> Awesome thanks guys, also I was wonderin if either of you knew if I could
> do
[quoted text clipped - 21 lines]
>> > just
>> > wondering if I was doing something wrong?
 
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.