I've used the if statement with the like many times and it works fine. My problem this time is I'm using a variable and it doesn't work. Here's the code
the testCheck always shows False. I'm getting the name v1 from the controls in my form the v1 Variable shows "Warm Up Monday" I get the VBanqName from a different table and it shows "Warm Up Monday" it could also show "Warm Up Monday Early" that is why I want to add the "*" so it will pick up everything with "Warm Up Monday" in the VBanqName. I've tried different ways to the if statement to work like
but that doesn't work either. If I just type "Warm Up Monday*" then it works fine. Does anybody have any clues as to why the variable doesn't work.
Thanks
Code:
Dim v1 As String
v1 = Forms("editmasterWannual").Controls("tabctl196").Pages(1).Caption
V2 = Forms("editmasterWannual").Controls("tabctl196").Pages(2).Caption
v3 = Forms("editmasterWannual").Controls("tabctl196").Pages(3).Caption
v4 = Forms("editmasterWannual").Controls("tabctl196").Pages(4).Caption
Dim testCheck As Boolean
V1a = v1 + "*"
testCheck = VBanqName Like V1a
If testCheck = True Then
Code:
If VBanqName Like V1a then
Thanks
Comment