Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Replacing one character with another (97)

    I have a field called address1 on a report which displays on one line, with stars (*) separating the different parts of the address. How can I amend the Control Source for this field to an expression which replaces stars with spaces?? Thanks, Andy.

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

    Re: Replacing one character with another (97)

    Unlike Access 2000 and up, Access 97 does not have a built-in Replace function. You will find a custom ReplaceString function in <post#=168756>post 168756</post#>, you can copy it into a module, then use it on the report like this:

    <code>=ReplaceString([Adress1],"*"," ")</code>

    or if you'd rather have line feeds instead of spaces

    <code>=ReplaceString([Adress1],"*",Chr(13) & Chr(10))</code>

    (make sure that your text box and the section it is in have Can Grow = Yes to accomodate for multiple lines, or make the text box high enough.)

Posting Permissions

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