Consulting

Results 1 to 8 of 8

Thread: Solved: Find/Replace in Form Field Help Text

  1. #1
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location

    Solved: Find/Replace in Form Field Help Text

    We've misspelled THAT in our help text in a gazillion form fields. Anybody got some code that will find and replace it for us??

    We misspelled it as THART.

    ~Anne Troy

  2. #2
    VBAX Regular
    Joined
    Jul 2004
    Location
    San Bernardino, California
    Posts
    69
    Location
    Are all of the forms fields in one document?

  3. #3
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    yep
    ~Anne Troy

  4. #4
    VBAX Regular
    Joined
    Jul 2004
    Location
    San Bernardino, California
    Posts
    69
    Location
    I'm no Word Pro (like you!), But this worked!

    	Dim frmfld As FormField
     
    	For Each frmfld In Me.FormFields
     
    		frmfld.Result = Replace(frmfld.Result, " THART ", " that ", , , vbTextCompare)
     
    	Next frmfld

  5. #5
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Well, it sure LOOKED good.
    But it didn't change anything. It's in the HELP TEXT of the form fields, not in the form fields.


    Really looked cool, tho.

    I actually ran this:

    [vba]Option Explicit
    Sub FixThart()
    Dim frmfld As FormField

    For Each frmfld In Me.FormFields

    frmfld.Result = Replace(frmfld.Result, " THART ", " that ", , , vbTextCompare)

    Next frmfld


    End Sub[/vba]
    ~Anne Troy

  6. #6
    VBAX Regular
    Joined
    Jul 2004
    Location
    San Bernardino, California
    Posts
    69
    Location
    OK, I missed the whole Help Text in the first post. Try this:

    	Dim frmfld As FormField
     
    	For Each frmfld In Me.FormFields
     
    		frmfld.HelpText = Replace(frmfld.HelpText, " THART ", " that ", , , vbTextCompare)
     
    	Next frmfld

  7. #7
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Loverly!!
    ~Anne Troy

  8. #8
    VBAX Regular
    Joined
    Jul 2004
    Location
    San Bernardino, California
    Posts
    69
    Location
    Quote Originally Posted by Dreamboat
    Loverly!!
    You know it!

Posting Permissions

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