Is it possible to get some sort of SQL Like operator in a VB if/then statement?
Currently, on one form, some items have a tag "Vanity Object" on them. When a command button is clicked, the vanity objects are hidden.
I'd like to continue with this practice. I'd like to give some objects a "PinkPanther" tag (not really the name, I'm not yet sure what I'll call it). So, objects would have the following tags:
'nothing
"Vanity Object Pink Panther"
"Vanity Object"
"Pink Panther"
I'd like to change my code to be something on the order of:
If Me(i).Tag Like "*Vanity Objecty*" Then...
I realize that this can't be done with a normal If/Then statement. But, perhaps it could be done with some other statement? I mean, I just learned about IIf a few days ago, who knows what else might be out there?
Currently, on one form, some items have a tag "Vanity Object" on them. When a command button is clicked, the vanity objects are hidden.
Code:
For i = 0 To Me.Controls.Count - 1
If Me(i).Tag = "Vanity Classes" Then
Me(i).Visible = Hidden
End If
Next i
'nothing
"Vanity Object Pink Panther"
"Vanity Object"
"Pink Panther"
I'd like to change my code to be something on the order of:
If Me(i).Tag Like "*Vanity Objecty*" Then...
I realize that this can't be done with a normal If/Then statement. But, perhaps it could be done with some other statement? I mean, I just learned about IIf a few days ago, who knows what else might be out there?