one combo box based on a list box

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!!
 
D

Douglas J. Steele

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;
 
G

Guest

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!!
 

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