Implementing 'Show All' in a combobox?

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
 
T

Tom van Stiphout

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top