Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I remove a Carriage Return Character from a report before exporting to a .pdf?

Posted on 2015-01-21
4
Medium Priority
?
469 Views
Last Modified: 2015-01-21
I have a report that generates in my Access database, and it displays perfectly from within.  The report has several unbound text boxes that are filled with multiple lines of options each time the report is created.  This is done because the options are different every time.  

I am generating a carriage return between each option because I want the list in the text box to look like this:

Option1
Option2
Option3

Instead of this:

Option1Option2Option3

I am forcing the carriage returns in the OnFormat event when the report is created by adding the following code inbetween each option:

& Chr(10) & Chr(13)

This all works fine within Access.  However, when I choose to export the report as a .pdf, the text boxes show a question mark inside of a square at the beginning and end of each line within the text boxes.

Example of unwanted characters
Is there any way to be able to export this report to a .pdf without these characters showing in the exported file?
0
Comment
Question by:jmcclosk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 40562914
Not sure but using vbCRLF
...worked for me:

Me.txtStack = Me.FN & vbCrLf & Me.LN
reportpdf
sample db is also attached

JeffCoachman
Database53.mdb
0
 

Author Closing Comment

by:jmcclosk
ID: 40562926
Ahh, the simplicity of it!  Thank you!  That did the trick!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40562930
This worked with unbound textboxes as well (in the report and the resulting PDF)
Modified sample attached as well:
Database53.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40562936
yes, ...in some situations the Character codes are beneficial,
In other cases vbcrlf maybe better,

This is why it is best to know both methods...
;-)

Jeff
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question