If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Parameter query
I'm creating a parameter query in my database, but I'd like the users to be
able to choose the parameter (like from a dropdown list) instead of having to know the exact spelling of the parameter. Is this possible? The selections for the parameter are in a separate table. Thanks! Darhl |
#2
|
|||
|
|||
Darhl,
Suppose you make a form called frmQueryParameters, and put a combo box on it to read the values from the table so the user can choose from, named Combo1. The criterion in your query should be: [Forms]![frmQueryParameters]![Combo1] HTH, Nikos Darhl Thomason wrote: I'm creating a parameter query in my database, but I'd like the users to be able to choose the parameter (like from a dropdown list) instead of having to know the exact spelling of the parameter. Is this possible? The selections for the parameter are in a separate table. Thanks! Darhl |
#3
|
|||
|
|||
Hi Nikos,
Thanks for the idea, it seems like it should work, but it's not. I did as you suggested, but the dialog box that comes up asking for the parameter merely says "[Forms]![frmQueryParameters]![Combo1]" and still just gives me a text box for me to type in my selection, then the query works. I'm not getting the dropdown box in there like I want. Any other ideas? Darhl "Nikos Yannacopoulos" wrote in message ... Darhl, Suppose you make a form called frmQueryParameters, and put a combo box on it to read the values from the table so the user can choose from, named Combo1. The criterion in your query should be: [Forms]![frmQueryParameters]![Combo1] HTH, Nikos Darhl Thomason wrote: I'm creating a parameter query in my database, but I'd like the users to be able to choose the parameter (like from a dropdown list) instead of having to know the exact spelling of the parameter. Is this possible? The selections for the parameter are in a separate table. Thanks! Darhl |
#4
|
|||
|
|||
You have to open the Form *first*, select a value in the ComboBox and then
run the Query. The Query won't open the Form for you. -- HTH Van T. Dinh MVP (Access) "Darhl Thomason" wrote in message ... Hi Nikos, Thanks for the idea, it seems like it should work, but it's not. I did as you suggested, but the dialog box that comes up asking for the parameter merely says "[Forms]![frmQueryParameters]![Combo1]" and still just gives me a text box for me to type in my selection, then the query works. I'm not getting the dropdown box in there like I want. Any other ideas? Darhl |
#5
|
|||
|
|||
OK, I understand, however it still doesn't work. I select the value in the
combo box, then run the other form that pulls the query...but doesn't return any values... d "Van T. Dinh" wrote in message ... You have to open the Form *first*, select a value in the ComboBox and then run the Query. The Query won't open the Form for you. -- HTH Van T. Dinh MVP (Access) "Darhl Thomason" wrote in message ... Hi Nikos, Thanks for the idea, it seems like it should work, but it's not. I did as you suggested, but the dialog box that comes up asking for the parameter merely says "[Forms]![frmQueryParameters]![Combo1]" and still just gives me a text box for me to type in my selection, then the query works. I'm not getting the dropdown box in there like I want. Any other ideas? Darhl |
#6
|
|||
|
|||
Does the BoundColumn of the ComboBox corresponds to the value you are
looking for? Note that what displays in the ComboBox may not be the value of the ComboBox (that is passed to the Query). The Value of the ComboBox (i.e. the value of the BoundColumn of the selected row) is passeded to the Query, not what's displayed. -- HTH Van T. Dinh MVP (Access) "Darhl Thomason" wrote in message ... OK, I understand, however it still doesn't work. I select the value in the combo box, then run the other form that pulls the query...but doesn't return any values... d |
#7
|
|||
|
|||
Also, you have substituted my hypothetical form and combo names with the
actual ones, right? Van T. Dinh wrote: Does the BoundColumn of the ComboBox corresponds to the value you are looking for? Note that what displays in the ComboBox may not be the value of the ComboBox (that is passed to the Query). The Value of the ComboBox (i.e. the value of the BoundColumn of the selected row) is passeded to the Query, not what's displayed. |
#8
|
|||
|
|||
Yep, sure have...not sure why it's not working.
d "Nikos Yannacopoulos" wrote in message ... Also, you have substituted my hypothetical form and combo names with the actual ones, right? Van T. Dinh wrote: Does the BoundColumn of the ComboBox corresponds to the value you are looking for? Note that what displays in the ComboBox may not be the value of the ComboBox (that is passed to the Query). The Value of the ComboBox (i.e. the value of the BoundColumn of the selected row) is passeded to the Query, not what's displayed. |
#9
|
|||
|
|||
If you want, you are welcome to compact (and zip if big) your database
and mail it to me to have a look. Darhl Thomason wrote: Yep, sure have...not sure why it's not working. d "Nikos Yannacopoulos" wrote in message ... Also, you have substituted my hypothetical form and combo names with the actual ones, right? Van T. Dinh wrote: Does the BoundColumn of the ComboBox corresponds to the value you are looking for? Note that what displays in the ComboBox may not be the value of the ComboBox (that is passed to the Query). The Value of the ComboBox (i.e. the value of the BoundColumn of the selected row) is passeded to the Query, not what's displayed. |
#10
|
|||
|
|||
Great question, I'll check that out this morning.
Thanks! Darhl "Van T. Dinh" wrote in message ... Does the BoundColumn of the ComboBox corresponds to the value you are looking for? Note that what displays in the ComboBox may not be the value of the ComboBox (that is passed to the Query). The Value of the ComboBox (i.e. the value of the BoundColumn of the selected row) is passeded to the Query, not what's displayed. -- HTH Van T. Dinh MVP (Access) "Darhl Thomason" wrote in message ... OK, I understand, however it still doesn't work. I select the value in the combo box, then run the other form that pulls the query...but doesn't return any values... d |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pass a parameter to nested query | laura | Running & Setting Up Queries | 6 | February 22nd, 2005 02:49 PM |
How to use a Access Query that as a parameter into Excel database query | Karen Middleton | Running & Setting Up Queries | 1 | December 13th, 2004 07:54 PM |
Populate report header field from query parameter | jh | Setting Up & Running Reports | 7 | November 13th, 2004 06:38 AM |
Calling Parameter Query With SQL | ChrisM | General Discussion | 0 | August 4th, 2004 01:07 PM |
Parameter Query Help | mark | Running & Setting Up Queries | 4 | June 2nd, 2004 04:40 PM |