Implementing 'Show All' in a combobox?

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

Hi,

I have a main form and a subform. In the main form, I have a combox to
display Name of provinces (bound to tblprovinces) and in the subform will
display all records belong to the selected province.

Everytime the main form is open, it show empty report untill user select a
province. I want to add a"Show All" to the combobox so that when the form is
opened all records of all the provinces would show in the sub form.

Is there a way to allow this to happen?

SF
 
Yes. You can add an extra record to the combobox with a union query:
select ProvID, ProvName from Provinces
union
select -1, "All" from Provinces

Then, assuming you setup LinkMasterFields/LinkChildFields with your
subform, you would have to break that link (set those properties to
"") if "All" was selected.

-Tom.
Microsoft Access MVP
 
Back
Top