Print Page | Close Window

Replacing <BR> in access reports

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9574
Printed Date: 28 March 2026 at 2:24am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Replacing <BR> in access reports
Posted By: manufan
Subject: Replacing <BR> in access reports
Date Posted: 05 February 2004 at 2:17pm
I have the guestbook app from webwiz which uses Access as the backend. The comments field is a memo field. In the ASP code used to input the data as a new record, it uses the REPLACE function so that when the user presses Enter in the <TEXTAREA>, the vbcrlf is replaced with a <BR>

However, the <BR> is stored in the field in the database - which s fine but now I want to generate an Access report - in Access. I don't want the <br> to print.

The report is based on a query. I've tried creating a new field in the query using the REPLACE function:

Expr1: Replace([Comments],"<br>",vbcrlf)

But it doesn't understand vbcrlf and if I put it in "" it actually puts the vbcrlf in the field

Any ideas?

Thanks



Replies:
Posted By: Mart
Date Posted: 05 February 2004 at 2:46pm

In your SQL query just use:

SELECT Replace(comments, '<br>', '') As comments ...

Where comments is the field with the line breaks in.



Posted By: manufan
Date Posted: 05 February 2004 at 3:21pm
OK, that removes the <br>'s from the comments field, however, I do want it to print out on separate lines, for example, in the Comments field, I have

The cat sat <br>on the mat

When this is output to a browser using ASP, it prints

The cat sat
on the mat

I want it to print the same way in the access report. If I just remove the <br>'s it will print as

The cat sat on the mat

in the report. What I actually need to do is replace the <BR> which is stored in the memo field with a character that Access will not print at report runtime but which Access understands as a linebreak



Posted By: ljamal
Date Posted: 05 February 2004 at 4:01pm
with SQLServer you can just use a line break try replacing it with a physical line break

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Mart
Date Posted: 05 February 2004 at 5:04pm

Oh sorry, Try this then:

SELECT Replace(comments, '<br>', vbcrlf) As comments




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net