ms access 2010 - How to show all items in Listbox that is linked to dropdown -
in access userform have listbox linked dropdown field. in dropdown field user can choose country, , listbox updates , shows records relevant country.
i have described how listbox filter based on selection in dropdown in question here.
while managed solve 1 problem there created another.
now when open form, listbox empty instead of showing records.
my question: how can show records in listbox begin , have user filter list based on dropdown?
the sql code in listbox following:
select tblfunds.morningsstar_fund_name, tblfunds.isin, tblfunds.rdr, tblisin_country_table.country tblfunds inner join tblisin_country_table on tblfunds.isin = tblisin_country_table.isin group tblfunds.morningsstar_fund_name, tblfunds.isin, tblfunds.rdr, tblisin_country_table.country, tblfunds.fund_selection having (((tblisin_country_table.country)=[forms]![frmmain]![ddncountry].[text]) , ((tblfunds.fund_selection)=0));
so ended solving 1 well... bit of online article can no longer find unfortunately (otherwise reference here):
select tblfunds.morningsstar_fund_name, tblfunds.isin, tblfunds.rdr, tblisin_country_table.country tblfunds inner join tblisin_country_table on tblfunds.isin = tblisin_country_table.isin group tblfunds.morningsstar_fund_name, tblfunds.isin, tblfunds.rdr, tblisin_country_table.country, tblfunds.fund_selection having (((tblisin_country_table.country) nz([forms]![frmmain]![ddncountry].[text],'*')) , ((tblfunds.fund_selection)=0)); the important part this...
like nz([forms]![frmmain]![ddncountry].[text],'*')) , ((tblfunds.fund_selection)=0)); essentially nz function lets return value when variant null. had return * ofcourse sql equivalent of return all.
Comments
Post a Comment