Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2005
    Posts
    12

    Unanswered: View line breaks in textbox on a report

    Hi guys

    I have a report summary which will display the total comments and feedback from a survey. I am trying to make the report scalable as the comments boxes will only get bigger as more people fill them in. I have already written a fxn to store all the comments in a single field, each comment separated by a line break. My next problem is getting the report to acknowledge them! At the moment they are just showing up as a linebreak box. How can I manipulate the textbox to read the linebreaks as well as the text?
    Thanks a lot,

    Kate
    Attached Thumbnails Attached Thumbnails linebreaks_example.JPG  

  2. #2
    Join Date
    Feb 2005
    Posts
    333
    I'm not sure what your function does but try using vbCrLf for your line break.

    Code:
    line1 & vbCrLf & line2
    wiil look like
    Code:
    line1
    line2

  3. #3
    Join Date
    Nov 2005
    Posts
    12
    Nice one campster,
    I had been using: sql & Chr$(13)
    vbCrLf works a treat.
    Cheers for that

  4. #4
    Join Date
    Nov 2005
    Posts
    12
    Ah, one more quickie.
    When you count the length of a string, does a linebreak count as 1 character?
    I need to remove the last linebreak from the string. At the mo, my code looks like:
    Code:
            sqlLength = Len(sql)
            sql = Mid$(sql, 1, sqlLength - 1)
    but it doesn't seem to remove it? Not sure it can't be treated as a normal character, perhaps and I need to find the last linebreak first? But if I do find it then, do I use the Replace fxn and replace the break with a "" (empty char)?

  5. #5
    Join Date
    Feb 2005
    Posts
    333
    There is probably a better way to do it but vbCrLf is actually 2 characters. A carriage return and a line feed. your code sould work if you use -2.

    I'm sure that the real access guys can provide a more efficient approach.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you could test if the last charcters in your sentance were insode (or outisde) and acceptable range using ASC() to convert the specified character to a number and take appropriate action.

    right$(), Mid$() and ASC() functions will be worth a look

    HTH
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •