Select Case rpt_name
If I want results of any Report Name beginning with the word Audit, how do I write that?
Pseudocode =
Case Like "AUDIT"*
Thank you.
Michael
Using "Like*" in Select Case (SOLVED)
-
- 4StarLounger
- Posts: 573
- Joined: 10 Feb 2010, 17:32
Using "Like*" in Select Case (SOLVED)
Last edited by Michael Abrams on 03 Jul 2014, 18:34, edited 1 time in total.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Using "Like*" in Select Case
AFAIK, you can't use the Like operator in a Select Case statement.
Try this:
If rpt_name Like "AUDIT*" Then
Try this:
If rpt_name Like "AUDIT*" Then
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Using "Like*" in Select Case
Rudi is correct, Select Case doesn't work with Like, so you have to use If ... Then.
PS There is a sneaky way to use Like in a Select Case statement, but then you have to write out the conditions, so it's not really more efficient than a series of If Then ElseIf ... statements:
PS There is a sneaky way to use Like in a Select Case statement, but then you have to write out the conditions, so it's not really more efficient than a series of If Then ElseIf ... statements:
Code: Select all
Select Case True
Case [Report Name] Like "audit*"
...
Case [Report Name] Like "yearly*"
...
Case [Report Name] = "Summary"
...
Case Else
...
End Select
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 573
- Joined: 10 Feb 2010, 17:32
Re: Using "Like*" in Select Case
Select Case True actually works as I need it. Pretty slick !
Thank you guys .
Michael
Thank you guys .
Michael