Using a Form to Select Query Values for Report

  • Thread starter Thread starter serno001
  • Start date Start date
S

serno001

Hello all,

I am looking for a site that would provide a tutorial to design a form
that allows the user to select the specific values (pull down menus)
for each query value. These query values, once set, would be used
to develop a report.

Any help would be welcomed
 
Hello all,

I am looking for a site that would provide a tutorial to design a form
that allows the user to select the specific values (pull down menus)
for each query value. These query values, once set, would be used
to develop a report.

Any help would be welcomed

I don't know of a tutorial for this, but the procedure is
straightforward.

You create a form with combo boxes listing criteria to be used in the
query. Let's say this form is called frmCrit. Then you use the
results of the criteria selected on frmCrit as criteria in the query
(let's call it qryCrit). For instance, let's say there is a combo box
on frmCrit called cboCrit0. You reference this in qryCrit in the
condition row for the corresponding field in the query as such Forms!
frmCrit!cboCrit0. Essentially, on frmCrit you attach code to a button
or combo box etc. that opens the report based on qryCrit once all the
required criteria are selected.

If this doesn't make sense, I can create a little instructional
database to illustrate this and e-mail it to you...

Ross La Haye
 
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/access/HA011730581033.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


John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
Back
Top