Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    35

    Unanswered: Using a Wildcard function in VBA

    Hi, I am sure this question has appearered on numerous occasions.. Does anybody know if a wildcard function can be used within a VBA statement, For example:

    strOutLine = Left(strInLine, 0) & "&&" & Mid(strInLine, 1)
    ElseIf Left(strInLine, 7) = "LIN**AN" Then

    I have many different variations of "LIN**AN", such as "LIN**HN", "LIN**DN" etc so I need carry out different combinations of searches.

    Is there a simple function which can be used or will I need to create some kind of array?

    Thanks Ste

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can use the Like operator: result = string Like pattern
    Regular expressions can be used as a pattern (see Access Help).
    Have a nice day!

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    ElseIf Left(strInLine, 7) Like "LIN*" Or Left(strInLine, 7) Like "*AN" .... etc Then
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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