G
Guest
I am trying to apply a filter but the VB syntax keeps getting in the way. The
problem is the single quotes before the word like and at the end. VB demands
that they be there, but they seem to be preventing the filter from working.
When I filter by form the code is there with the single quotes at the
beginning and end and I get zero results. When I remove the single quotes and
apply the filter, it works perfectly. How do I write the code in VB so the
filter works?
..Filter = "[LastName] = 'Like """ & Left([TargetName], 3) & "*""'"
result is
[LastName] = 'Like "Smi*"' which doesn't want to work,
however,
Like "Smi*" gets me everyone whose last name begins with Smi, which is what
I want. Can anyone help me with the VB syntax for pushing a like filter into
a form?
Thanks
Michael
problem is the single quotes before the word like and at the end. VB demands
that they be there, but they seem to be preventing the filter from working.
When I filter by form the code is there with the single quotes at the
beginning and end and I get zero results. When I remove the single quotes and
apply the filter, it works perfectly. How do I write the code in VB so the
filter works?
..Filter = "[LastName] = 'Like """ & Left([TargetName], 3) & "*""'"
result is
[LastName] = 'Like "Smi*"' which doesn't want to work,
however,
Like "Smi*" gets me everyone whose last name begins with Smi, which is what
I want. Can anyone help me with the VB syntax for pushing a like filter into
a form?
Thanks
Michael