From: iccsi on
I have a dropdown on the form and would like to filter records on the
form chosen by users.

It works for the filter, but I have issue when user leave it blank to
have all recrods without filter.

I tried to use [MyField] = [forms]![MyForm]![MyDropDown] or [forms]!
[MyForm]![MyDropDown] is null in the form filter property which filter
empty dataset. It seems the [MyForm]![MyDropDown] is null is true.

I tried to my form bound to a query and query has the criteria base on
the dropdown, but form failed to load, since the dropdown is not
created.

Any suggestions are appreciated,

From: Douglas J. Steele on
Are you saying that you're trying to use a combo box on the form to filter
that form?

In what event do you have the code to set the filter? If it's the form's
Open event, move it to the form's Load event.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"iccsi" <inungh(a)gmail.com> wrote in message
news:b648df22-e85b-4918-a20f-e33accfcd42f(a)a15g2000yqm.googlegroups.com...
>I have a dropdown on the form and would like to filter records on the
> form chosen by users.
>
> It works for the filter, but I have issue when user leave it blank to
> have all recrods without filter.
>
> I tried to use [MyField] = [forms]![MyForm]![MyDropDown] or [forms]!
> [MyForm]![MyDropDown] is null in the form filter property which filter
> empty dataset. It seems the [MyForm]![MyDropDown] is null is true.
>
> I tried to my form bound to a query and query has the criteria base on
> the dropdown, but form failed to load, since the dropdown is not
> created.
>
> Any suggestions are appreciated,
>