Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Replace Characters (A2k7 SP1)

    Hi All,
    I have tried to replace the little square boxes in the VersionString from a SQL Server (AccessFormat.jpg in the attached zip file as displayed in an Access textbox) with a vbCrLf during an INSERT INTO (to hopefully keep most of the formatting) with coding like these:

    Replace(strVersionString, Chr(13) & Chr(10), vbCrLf)
    Replace(strVersionString, Chr(13) & Chr(10), & vbCrLf &)
    and a couple of other iterations which have not been successful.

    (Picture WordFormat.jpg in the attached zip file is for your info as to how the VersionString appears in Word.)

    Would someone please enlighten me in the proper method?
    Thank you.
    Attached Files Attached Files
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Replace Characters (A2k7 SP1)

    In the first place, vbCrLf = Chr(13) & Chr(10), so replacing Chr(13) & Chr(10) with vbCrLf won't do anything.
    In the Word picture, you can see that the second character is a tab character vbTab = Chr(9). Try the following:

    strVersionString = Replace(strVersionString, vbTab, "")

    This should remove the tab characters. Next, if you want to want to see the carriage returns in Access, try

    strVersionString = Replace(strVersionString, vbCr, vbCrLf)

    If that doesn't work, try

    strVersionString = Replace(strVersionString, vbLf, vbCrLf)

    If you want to remove the carriage returns, use "" instead of vbCrLf

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Replace Characters (A2k7 SP1)

    Thanks Hans,
    Here's what I used:

    Replace(strVersionString, vbLf & vbTab, vbCrLf)
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Replace Characters (A2k7 SP1)

    That the most efficient way. I suggested separate replacements to be able to troubleshoot.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Replace Characters (A2k7 SP1)

    Yup, that's exactly what I did to. <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>
    Thanks again.
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

Posting Permissions

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