Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wildcard Usage (AXP / VBA)

    How do you use reference to a wildcard character within VBA? I am trying to use something like:

    if strTest = "test*" then..... and this doesn't work because it is seeing that as a literal string. How do I make it so that all entries starting with "test" show up?

    Thanks,
    Mark

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wildcard Usage (AXP / VBA)

    If Left(strTest,4) = "test" Then


    should do the job.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Wildcard Usage (AXP / VBA)

    Thanks Steve,
    Will try it!

    Mark

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

    Re: Wildcard Usage (AXP / VBA)

    Steve's solution will work fine. Another way to do it is

    If strTest Like "test*" Then

Posting Permissions

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