Re: Report based on parameter query

Tech-Archive recommends: Fix windows errors by optimizing your registry



Okay, good. Now, I am back to my original suggestion with a new twist.
The form I suggested earlier is still a good idea (IMHO). But, make the
recordsource of the form the query that returns the parameters you want to
use. Use bound controls for the fields to be used as parameters.
Then build a string to use as the Where argument of the OpenReprort method
using the values of the bound controls.

This doesn't require changes to you query.
It takes no user intervention.
You can open the form from anywhere.
If you don't need the user to see it, open it hidden.

--
Dave Hargis, Microsoft Access MVP


"Amy Blankenship" wrote:

The query that returns the parameters doesn't need any parameters. It just
looks up the last response from any student, sees who answered it, what
question it was to, what exam it was part of, and whether the exam session
was open or closed. Once that query is run, at present I am popping up a
message box that says "these are the answers to the questions you're about
to be asked" and open the form, which then pops up the dialogs for the
parameters. If I could pass the results directly into the parameters, the
user would never need to know.

-Amy


"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:342E7422-F04B-4AFA-B403-7C4035270E52@xxxxxxxxxxxxxxxx
Thanks, Amy. It appears the query you run requires parameters.
"by running a query based on the last response to any question entered by
any student"

So if I am understanding correctly you need to put in a student id and a
question id to run the query that returns your parameters?

Sorry, but I want to make sure to get this right.
--
Dave Hargis, Microsoft Access MVP


"Amy Blankenship" wrote:

OK, here's the deal, in detail:

I have a separate program that essentially acts as an engine to allows
students to take exams based on content stored in the database, and it
stores information about what they did and when. Ordinarily, all the
reporting is done at the end of an exam based on queries run from the
engine. It takes a fair amount of effort to get an exam to a point where
it
would actually be usable through the engine, but we can make a "mock
exam"
with considerably less effort, since we don't care about the content
displayed on the screen. I do this in Access forms. This moves the need
to
report while we're unit testing into Access, but I don't want to
duplicate
all the effort that has already been spent on my queries.

My client just wants to be able to run the mock exam and look at a report
based on the most recent student and whatever exam they took last.
However,
the queries need to have a numeric parameter that tells them the student,
the exam, and a boolean parameter that tells them whether the result
we're
interested in is from an open session or a closed one.

I can easily determine these parameters by running a query based on the
last
response to any question entered by any student and working my way up the
chain. So I want to use the result of that query to enter the parameters
for the query and in so doing suppress the dialogs that ask for the
parameter values. In the interim, I'm just popping up a message box that
tells the user what to enter to get the most recent report ;-).

I've already tried this http://www.mvps.org/access/reports/rpt0014.htm,
and
it doesn't seem to use the open recordset, but instead reruns its SQL
(and
so you get parameter popups).

Thanks;

Amy

"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AF29F16E-D8D5-4427-BCD7-D81F0B530785@xxxxxxxxxxxxxxxx
Are the parameter values always the same? If not, how do you change
them?
I
think we can make this work for you, but I need to know how you pass
the
parameters currently.

--
Dave Hargis, Microsoft Access MVP


"Amy Blankenship" wrote:


"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2453B5B8-1370-4D4E-8FFB-1144C50BFDA2@xxxxxxxxxxxxxxxx
The answer to your question is as asked.
When you ask a question, provide the What.
The answers will provide the How.

What is the problem with running the query? Why does it matter
where
it
is
run from.

I understood the question as asked. Did you understand the answer?

I don't think you did. The "What" I asked is about passing _real_
parameters to a parameter query as opposed to passing references to
form
controls. As I said, the query is based on a stack of other queries
that
require _real_ parameters to run, and if I were to go back and
recreate
them
to use form control references that would cause two problems

1) It would take far more time than I have already wasted trying to
figure
this out

2) It would create a maintenance nightmare of having two parallel
tracks
of
queries that have to be edited every time something changes.

Perhaps I didn't understand your answer, though. Were you suggesting
that
there is a way to get the form references somehow _into_ a parameter
query
that is expecting actual values as opposed to form references? If so,
could
you please clarify, as I am not aware of what the syntax would be to
do
that.

Thanks;

Amy









.



Relevant Pages

  • Re: Report based on parameter query
    ... It takes a fair amount of effort to get an exam to a point where it ... all the effort that has already been spent on my queries. ... based on the most recent student and whatever exam they took last. ... I can easily determine these parameters by running a query based on the last ...
    (microsoft.public.access.reports)
  • Re: Report based on parameter query
    ... The query that returns the parameters doesn't need any parameters. ... looks up the last response from any student, sees who answered it, what ... question it was to, what exam it was part of, and whether the exam session ... all the effort that has already been spent on my queries. ...
    (microsoft.public.access.reports)
  • Re: Report based on parameter query
    ... It appears the query you run requires parameters. ... So if I am understanding correctly you need to put in a student id and a ... It takes a fair amount of effort to get an exam to a point where it ... all the effort that has already been spent on my queries. ...
    (microsoft.public.access.reports)
  • Re: Please help with a Query
    ... First I created two identical Select queries from the table. ... the third query using the two queries per your instructions on your first ... Project information contain project code ... if a student has 3 projects: ...
    (microsoft.public.access.queries)
  • Re: Setting Table Relationships- Why?
    ... >queries, I noticed that I would usually need to tweak the ... >pre-set relationships depending on the query. ... a Student is a type of entity (with ... classes, an Enrollment is another type of entity, with the Student ...
    (microsoft.public.access.tablesdbdesign)