Results 1 to 3 of 3

Thread: [RESOLVED] Invalid Qualifier

  1. #1

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Resolved [RESOLVED] Invalid Qualifier

    I'm not sure where to post this, it's VBA for an Access Database.

    I have this in a code section, and it's selecting "text" in the function's code and highlighting the function declaration, telling me that it has an "Invalid Qualifier".

    Code:
    Private Function Escape(ByVal text As String) As String
        Escape = text.Replace("'", "{QUOT}").Replace(vbCrLf, "{CRLF}").Replace(vbCr, "{CR}").Replace(vbLf, "{LF}")
    End Function
    Is this the right place to post?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Invalid Qualifier

    Thread moved to "Office Development/VBA" forum (the Database forum is for issues with the database side of things)

    You seem to be trying to write VB.Net code... the replace function should be like this:
    Code:
    Escape = Replace(text, "'", "{QUOT}")
    To replace multiple items either use multiple lines like that, or nest the calls (eg: Escape = Replace(Replace(text, "'", "{QUOT}"),vbCrLf, "{CRLF}") ).

  3. #3

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Invalid Qualifier

    It works! Thanks!

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width