Solved

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

Posted on 2015-01-21
4
357 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
  • 3
4 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now