A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using Combo Boxes as a Source for Parameter Queries



 
 
Thread Tools Display Modes
  #1  
Old March 5th, 2010, 03:06 PM posted to microsoft.public.access.queries
venajoe
external usenet poster
 
Posts: 7
Default 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  
Old March 5th, 2010, 04:16 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old March 5th, 2010, 05:10 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.