Can anyone point me towards a how to that shows how to create cascading combo boxes in a form where the combo box values are all pulled from the same table? Or tell me if it's just not possible?
Thanks,
Evan
Can anyone point me towards a how to that shows how to create cascading combo boxes in a form where the combo box values are all pulled from the same table? Or tell me if it's just not possible?
Thanks,
Evan
Not really enough info, but usu,...
say cboState is picked NY.
to fill the cboCity box, in the cboState AFTERUPDATE event.
cboCity.requery
the query feeding the cboCity uses cboState in the criteria.
select City from TCities where state = forms!frmForm!cboState
the AFTERUPDATE code refreshes the list.
@Evan,
You may find these free video tutorials useful
http://www.datapigtechnologies.com/f...combobox1.html
http://www.datapigtechnologies.com/f...combobox2.html
Continuing ranman's example. Table of cities with fields for CityName, StateCode (and/or StateName).
State combobox:
SELECT DISTINCT StateCode FROM Cities ORDER BY StateCode;
City combobox:
SELECT CityName FROM Cities WHERE StateCode = [cboState] ORDER BY CityName;
Then code to requery the city combobox:
Me.cboCity.Requery
Code would go in cboState AfterUpdate or cboCity GotFocus events.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
orange has given you a couple of links with videos, the second one being specifically about cascading comboboxes, and June7 has given a succinct explanation on how it is done, but FYI, it not only is possible for the values in cascading comboboxes to come from the same table...they usually, by the very nature of the beast, come from the same table!
Linq ;0)>