Filtering the results of a query using a Drop-Down combo box

G

gavin

I have followed the example called "Filtering the results of a query using a
Drop-Down combo box" on
http://www.microsoft-accesssolutions.co.uk/query_filter.htm. This gives me a
combo box which enables me to select the parameter for a query. It works
fine except that when I select the arrow to drop down the list of possible
parameters I see a list of ALL the records in that field instead of just one
of each unique entry.

Does anyone know what I could have done wrong? I don't know if I have
explained that well enough.




Regards,



Gavin
 
D

Douglas J. Steele

Sounds as though you've based the combo box on the table itself. Create a
query that returns only distinct values (look at the query's properties),
and base the combo box on that query.
 
G

gavin

Thanks, Douglas. I tried so very hard to do exactly what it said in the
tutorial. I get so teed off - I have been using Access for years and I am
still clueless. Everything I try to achieve is a total struggle :-(

Can I ask how I do what you recommend? I said I was clueless....




Regards,


Gavin
 
D

Douglas J. Steele

Go the Query tab and create a new query in Design mode.

Add your table into the top half of the display, then drag whatever fields
you want from the table down into the grid. Set a sort order if you want. If
the Properties window isn't showing, go to View | Properties on the menu bar
to display it. Make sure you're looking at the query properties, not the
properties for a field. (To change to the query properties, click on the
gray area outside of the table)

The 4th property of the query should be Unique Values. Set it to Yes, and
you should be good to go.
 
G

gavin

Doug,
I have tried what you have suggested below but it still isn't working. I
have compared my database to one I have found on the web that does this and
as far as I can see my implementation is exactly the same - and yet mine
still has this anomaly. I spent a fair amount of time this afternoon trying
all sorts of variations but I still get the same result. The query works
fine but the drop down box lists ALL entries from that field.

Do you have any idea what else I could be doing wrong?


Regards,



Gavin
 
D

Douglas J. Steele

Not sure I understand what you mean. Are you saying that the query doesn't
have duplicates in it, but when you use that query as the combo box's Row
Source, the combo box has duplicates in it?
 

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