have combo box source city and province from table

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
 
P

Patrick Rouse [MVP]

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
 

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