ACCESS: parameterized query & dropdown list

Crepuscule9 Posted messages 1 Registration date   Status Membre -  
jllq Posted messages 7 Status Membre -
Hello everyone!

I'm brand new to the wonderful world of Access users... and I'm already stuck! So if any of you (or even several, the more the merrier!) could spare a little bit of your time to help me, I would be eternally grateful!

So, here is my situation:
I'm working in Access 2003, and I need to create a parameterized query on the client name from my Client table. So far, so good, but I would prefer to have a dropdown list to select my client's name, rather than having to type it all in the little "Enter a parameter value" window.
Well, yes, my clients have complicated names, and I mess up either in spelling or typing one time out of two, so it doesn't work as well... Especially since in the end, I'm not the one who will be using it, so if I can't even get it to work, even though I designed it, it might not be a pretty sight for the others!

So, is there a kind soul in this forum who could help me?
Thanks in advance!
Aurore

14 réponses

zenon Posted messages 729 Status Membre 180
 
Good evening,

With the dropdown list assistant, it's very easy.

Let's assume you have a form based on the clients table

You can create a dropdown list that includes the primary key of your table and the names of your clients.
Access will ask you what you want to do, choose to search for a record in a table or query.
Agree to hide the key column, and you're all set...

When you look at what happens, in the properties sheet of the list, you see under the format tab that Access has created two columns, that the first one has a width of 0 cm, and that it is this last one that is linked (in other words, it contains the primary key that allows filtering one and only one record from the table)
Under the data tab, you see the query in SQL mode, but you can display it in graphical mode by clicking on the three dots... on the right. It's in this window that you can choose to index the fields in alphabetical order, for example. If you add columns, don't forget to modify the number and width under the format tab.

You can refine and display multiple columns (e.g., first name and date of birth in your list, if you have namesakes).

Another way to do this is to create an independent text box that "pre-filters" the list and allows you to enter only the first letters of the name...
If you want, I can explain it to you.

PS your post would be better in the Database section.
15
jllq Posted messages 7 Status Membre
 
I have the same problem but with a query. I need to extract data regarding "clients." If I enter the client's name in my query, it works fine and gives me all "their payments." However, no matter how much I search, I can't figure out how to input the person's name from whom I want to extract the data, and I don't know how to create a dropdown list in a query.
0