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 / SQL Server / ADP / September 2005

Tip: Looking for answers? Try searching our database.

CHAR(13) in ADP Report Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Datawonk - 28 Sep 2005 21:05 GMT
Hi,

I am using a stored procedure as the source for a report in an Access
Project.  This report displays letters (which are generated by the
database into a single TEXT field for each person, similar to a
mail-merge feature).  The problem is that while CHAR(13) works as a
carriage return in SQL Server, it does not in Access (that uses
CHR(10)/(13)).

The code to generate the data in the stored procedure looks like this:

...
first + ' ' + last
+ CHAR(13) + address1
+ CHAR(13) + address2
...

and the physical data like this:

...
Joe Test
1000 Sample Drive
Suite 1100 A
...

However, when I view the report in the ADP, I have little rectangles
representing the CHAR(13) values, and all my text is run together.  If
I try to use CHR(13)/(10) in my code, I get an "'CHR' is not a
recognized function name." error.  If I put the CHR(10/13) in single
quotes it (obviously) treats it as standard text.

Any help with this problems would be greatly appreciated.

Thank you VERY much,
Birgit
Robert Morley - 28 Sep 2005 21:46 GMT
I could be wrong, but I believe SQL Server accepts *either* CHAR(13) or
CHAR(13) + CHAR(10) as a carriage return.  Access only accepts 13/10 (aka
CR/LF).  So if you replace all the CHAR(13)'s with CHAR(13) + CHAR(10), they
*should* both be happy.

Rob

> Hi,
>
[quoted text clipped - 31 lines]
> Thank you VERY much,
> Birgit
Datawonk - 28 Sep 2005 22:03 GMT
Hi Robert,

Thanks for the prompt response.  You are correct, Access will take the
13/10 ... however, I would like to "insert" that into the body of my
letter (the text field), instead of having to make an unbound text box
on my report and replacing the CHAR(13) with CHR(13) + CHR(10).

Any ideas how I can do that?

Thanks again,
Birgit
Datawonk - 28 Sep 2005 22:05 GMT
I just figured out my own question, if you use CHAR(13) + CHAR(10) in
your sql, Access will convert it correctly.

Thanks for the tip that I needed to use both.

Birgit
Robert Morley - 28 Sep 2005 22:28 GMT
Hehehe, that's what I'd meant...guess I just wasn't clear enough.

Rob

>I just figured out my own question, if you use CHAR(13) + CHAR(10) in
> your sql, Access will convert it correctly.
>
> Thanks for the tip that I needed to use both.
>
> Birgit
 
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.