Hi All,
I have to compare a string against a set of substrings.
However, the number of substrings to be matched with is not fixed. Thereby I'm confused how to write my IF statement.
For eg. if the string in tbl_nm is to be compared against these substrings FACT*, STG*, DIM*, the code would look like:
There may be even different substrings to be compared with. So the IF statement can't be hard-coded. How do I write the IF logic effectively?????
Please Help. Thanks a lot in advance...
I have to compare a string against a set of substrings.
However, the number of substrings to be matched with is not fixed. Thereby I'm confused how to write my IF statement.
For eg. if the string in tbl_nm is to be compared against these substrings FACT*, STG*, DIM*, the code would look like:
Code:
sub test()
tbl_nm = "FACT_CONTROL_ABC"
If tbl_nm Like "FACT*" or tbl_nm Like "STG*" or tbl_nm Like "DIM*" then
' Do Something
End If
end sub
Please Help. Thanks a lot in advance...