RcdFilter is a tag on the form that is being opened. I fixed the tag, but
now the form brings up all the records and not filtering.
> RcdFilter is a tag on the form that is being opened. I fixed the
> tag, but now the form brings up all the records and not filtering.
I'm not sure what you mean when you say "RcdFilter is a tag". However,
if you've "fixed it" in such a way that your code now compiles, then
maybe your problem comes from the fact this line:
> Case 1 sFilter = "[Companyid] = '2"
has an unbalanced single-quote. Assuming [Companyid] is a text field,
that line should be:
Case 1 sFilter = "[Companyid] = '2'"
Note that, if [Companyid] is a numeric field (not text), that should
just be
Case 1 sFilter = "[Companyid] = 2"
Also, I see that you are applying this filter to the current form, and
then opening another form. Which form is it that you're expecting the
filter to be applied to? You're doing nothing to apply the filter to
"frmPreview".

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Mary Bowman - 27 Apr 2005 22:52 GMT
Hooray! That did it. I put the case on the other form. It works.
Thanks Dick!!!