have combo box source city and province from table

  • Thread starter Thread starter CP
  • Start date Start date
C

CP

I want to use a combo box that allows the user to select a city and province
or state. I have a table called projects and each project has an address ie:
city, province/state etc. Is it possible to create a query that will list
all the cities along with its province/state that are in the projects table
but only show it once. Does it then make sense to use this as the source for
the combo box on another form.

Thanks
Chris
 
Sure. I'm not an Access Expert, but this is what I did to
accomplish this on a little database I created. This is
the SQL Query I run on the City ComboBox.

SELECT DISTINCT tblZIPCodes.City FROM tblZIPCodes WHERE
(((tblZIPCodes.StateCode)=Forms!frmDonors!State)) ORDER BY
tblZIPCodes.City;

Select Distinct makes is list only one instance of each
city, where the city exists in the State listed in my
State ComboBox. I have a macro that I set to requery
these ComboBoxes on events "GotFocus" and OnClick" so
they'll update if you change the values of either combobox.

Patrick Rouse
Microsoft MVP -Terminal Server
 
Back
Top