one combo box based on a list box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box that I would like to auto fill based on a list box. In
the combo box's properties, I have the row source set to
SELECT Circles.Friends FROM Circles WHERE (((Circles.Area) Like
[Forms]![Main Menu]![area_box])) GROUP BY Circles.Friends;

Circles is the table, Friends is the combo box, area_box is the list box.
Why doesn't this work and what can I do to get the desired results.

I would like to get the list of Friends based on their area. So, I'd like
to see the group of friends who live in NY. I'd put NY in the area box and
the combo box would populate with only the friends whose area is NY.

Thanks for any help you can provide!!
 
What's in the Area field: is it strictly NY and nothing else (no spaces,
etc.), or is NY part of what's there?

If NY is only part of what's there, try

SELECT Circles.Friends FROM Circles WHERE (((Circles.Area) Like & "*" &
[Forms]![Main Menu]![area_box] & "*")) GROUP BY Circles.Friends;
 
Your question led me to look at my table and I realized that the text field
the location was sitting in was 255 characters long. I changed it to 2 and
got the results I desired! Thank you so much for your help in this!!
-Jenny

Douglas J. Steele said:
What's in the Area field: is it strictly NY and nothing else (no spaces,
etc.), or is NY part of what's there?

If NY is only part of what's there, try

SELECT Circles.Friends FROM Circles WHERE (((Circles.Area) Like & "*" &
[Forms]![Main Menu]![area_box] & "*")) GROUP BY Circles.Friends;


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Jennyrd said:
I have a combo box that I would like to auto fill based on a list box. In
the combo box's properties, I have the row source set to
SELECT Circles.Friends FROM Circles WHERE (((Circles.Area) Like
[Forms]![Main Menu]![area_box])) GROUP BY Circles.Friends;

Circles is the table, Friends is the combo box, area_box is the list box.
Why doesn't this work and what can I do to get the desired results.

I would like to get the list of Friends based on their area. So, I'd like
to see the group of friends who live in NY. I'd put NY in the area box
and
the combo box would populate with only the friends whose area is NY.

Thanks for any help you can provide!!
 
Back
Top