Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Replacing <BR> in access reports
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Replacing <BR> in access reports

 Post Reply Post Reply
Author
manufan View Drop Down
Newbie
Newbie


Joined: 13 February 2003
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote manufan Quote  Post ReplyReply Direct Link To This Post Topic: Replacing <BR> in access reports
    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
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
manufan View Drop Down
Newbie
Newbie


Joined: 13 February 2003
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote manufan Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 4:01pm
with SQLServer you can just use a line break try replacing it with a physical line break
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2004 at 5:04pm

Oh sorry, Try this then:

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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.