Results 1 to 6 of 6
  1. #1
    nickgoldie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    10

    How to remove &NBSP from my form

    My form shows &NBSP and &AMP although the data looks fine in the database as a memo field (rich text).

    Example:
    1.Eliminate funding for Web Q&A on the city website.
    2. Eliminate the citizen and visitor tracking software that is interfaced with the INFO database.  This software is used  for questions and inquiries for city services. With the upgrades to the city's new website, Web Q&A is no longer a compatable tool.

    How do i fix this in my form? It is also affects all my reports.



    thakn you!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    You have remnants of HTML in your data. You might try to search for " removing HTML Tags and constants from text".

    Here's one link http://www.codeproject.com/KB/asp/removehtml.aspx

  3. #3
    joelmeaders is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    33
    Use this function:

    Function CleanStr(stInp As String, stSrch As String, stRepl As String) As String
    'This function will search through a string and replace
    'the specified text with a specified replacement.
    On Error GoTo ErrorHandler

    Dim Result As String

    Result = stInp
    If InStr(stInp, stSrch) > 0 Then
    Result = Replace(stInp, stSrch, stRepl)
    End If
    CleanStr = Result

    ExitProcedure:
    Exit Function

    ErrorHandler:
    MsgBox "Unable to clean string.", vbExclamation, "String Error!"
    Call AddErrorEvent(Err.Number, Err.Description, "CleanStr()")
    Exit Function
    End Function
    Remove the "AddErrorEvent" line because that's a custom function of mine.

    Use:
    Example MemoField: "this is the &nbsp same time as yesterday"
    CleanStr(MemoField, "&nbsp", "")

    Returns: MemoField: "this is the same time as yesterday"

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    The Replace() function will do the same.

  5. #5
    joelmeaders is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    33
    Quote Originally Posted by RuralGuy View Post
    The Replace() function will do the same.
    Good call lol. I don't remember why I used this function but I'm sure there was a reason.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    If you know the exact strings you want to replace, then as Joel and Allan have said - you can use the replace function.

    If you or some one has copied material from the web into a memo field, and there are various html "thingies" embedded within text, then you may want an html remover.

    Good luck with your project

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Try to remove everything to the right of SF
    By murphy in forum Queries
    Replies: 2
    Last Post: 09-15-2011, 03:20 PM
  2. Replies: 2
    Last Post: 07-10-2011, 07:22 PM
  3. Replies: 6
    Last Post: 02-08-2011, 09:22 PM
  4. remove filtering of a form
    By maxbre in forum Forms
    Replies: 3
    Last Post: 10-30-2010, 10:22 AM
  5. Remove items from Tabular Form
    By JoshS in forum Forms
    Replies: 3
    Last Post: 04-26-2010, 02:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums