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
|
|||
|
|||
Using Combo Boxes as a Source for Parameter Queries
Access Gurus,
I often encounter a situation where I want to run a select (parameter) query on a particular table, but instead of having the user type in their own parameter, I'd like for them to be able to choose, from a combo box that auto-completes, the actual item in the underlying table, then use this string as the basis for the parameter query. I want to limit the parameters to already-extant items in the underlying table and so avoid close-but-not-exact matching problems by free-typing the parameter. -- Joe Venable Virginia Beach, VA |
#2
|
|||
|
|||
Using Combo Boxes as a Source for Parameter Queries
Use this as criteria --
[Forms]![YourFormName]![ComboName] -- Build a little, test a little. "venajoe" wrote: Access Gurus, I often encounter a situation where I want to run a select (parameter) query on a particular table, but instead of having the user type in their own parameter, I'd like for them to be able to choose, from a combo box that auto-completes, the actual item in the underlying table, then use this string as the basis for the parameter query. I want to limit the parameters to already-extant items in the underlying table and so avoid close-but-not-exact matching problems by free-typing the parameter. -- Joe Venable Virginia Beach, VA |
#3
|
|||
|
|||
Using Combo Boxes as a Source for Parameter Queries
Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm Or check out this from MS http://office.microsoft.com/en-us/ac...730581033.aspx Or for another example http://allenbrowne.com/ser-62.html A brief quote from a John Vinson (Access MVP) posting. You'll need to create a small unbound Form (let's call it frmCriteria) with a Combo Box control (cboCrit) on it. Use the combo box wizard to select the table for the selections, and be sure that the bound field of the combo is the value you want to use as a criterion. Save this form. Now use =[Forms]![frmCriteria]![cboCrit] as the criterion in your Query. It's convenient to base a second Form or Report on the resulting query to display the results; if you put a button on frmCriteria to launch that form or report, the user can enter the criterion and view the results in one simple operation! End quote One thing to remember is that the form MUST be open in order for this to work. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County KARL DEWEY wrote: Use this as criteria -- [Forms]![YourFormName]![ComboName] |
Thread Tools | |
Display Modes | |
|
|