Repost for Dirk.

D

Dave the wave

Dirk:
You were providing me with some information regarding creating a subform
that could be filtered and sorted, then using the filter/sort info from the
subform to create a SQL statement that would create the recordset for a
report. I was away for a few days and I can not find the thread anywhere.

So far, every time I try to run my code I get a parameter dialog window
asking for the parameter that was supplied by the WHERE clause of the SQL
statement. As I recall, you thought the field might not be part of the
subforms underlying recordset. I did check on this and it seems to me that
it is.

I was thinking it might be better to simply layout a plan for creating all
the items needed and ask you to comment or point out any errors.

FORMS:
frmMain
sfrmSub

QUERIES:
qrySub
qryMain

PLAN:
qryMain: multi-table query. Certain columns from all records for calculating
statistical data
frmMain: displays calculated data and sfrmSub.
qrySub: multi-table query. Specific columns (different from the qryMain)
from all records, until "filter by selection" filtering is applied at
run-time.
build SQL statement using the Filter property, and Sort property of sfrmSub.
Select report design based on the field in the SQL WHERE clause. (I think
the report design will need to change depending on how the user has set up
the filtering. Optionally, reassign report controls at run-time.)
DoCmd OpenReport using the SQL statement to create the underlying record
set.

I'll ad my code after I get your initial reaction to my general plan.

Thank you very much for your time and attention.
 
D

Dirk Goldgar

Dave the wave said:
Dirk:
You were providing me with some information regarding creating a
subform that could be filtered and sorted, then using the filter/sort
info from the subform to create a SQL statement that would create the
recordset for a report. I was away for a few days and I can not find
the thread anywhere.

My last reply was:

Subject: Re: Where cluase of OpenReport
Date: Wed, 16 Jun 2004 00:16:23 -0400
Message-ID: <[email protected]>
Newsgroups: microsoft.public.access.formscoding

And the substance of it was:
Is that query named "qryRepackReview"? The filter you are trying to
apply specifically refers to qryRepackReview.ProductsDescription, and
I don't see a query named "qryRepackReview" anywhere in the SQL you
posted. As an experiment, try hard-coding this filter instead:

ProductsDescription="HDL Citrus Breeze"

</quote>

I don't have time at the moment to address your larger question, but
I'll be back later.
 
D

Dave the wave

Thanks Dirk. I will try this and get back to you. I really appreciate your
time and effort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top