
Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
yes, all solutions worked.
Here is what I didn't understand:
the syntax of { '" & [control] & "' }
is this necessary for all string values?

Signature
Chris Hayes
Still a beginner
> > What is wrong with my code?
> >
[quoted text clipped - 17 lines]
> Me.FilterOn = True
> End If
fredg - 16 Nov 2006 22:24 GMT
> yes, all solutions worked.
>
[quoted text clipped - 3 lines]
>
> is this necessary for all string values?
Yes.
A variable value must be concatenated into the string, and if it is a
text variable it must also be surrounded with single (or double
quotes).
Let's assume the value selected in the combo box was Jones.
Your expression:
Me.filter = "me.st2status = rslt"
Results in
Me.filter = "me.st2status = rslt"
literally rsit (not the value of rslt).
Me.Filter = "me.st2status = '" & rslt & "'"
results in
Me.Filter = "me.st2status = 'Jones'"
the value of rslt.
If the value is Number datatype, then ou do not surround the value
with quotes.
If rslt's value is 3 (as a number, not as a text 3), then
Me.filter = "me.st2status = " & rslt
results in
Me.filter = "me.st2status = 3"
Note that it still must be concatenated into the string.
Hope this is clear.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail