Great stuff....(sounds like you got something starting to work!!).
By chance do you know how to do this on a subreport? I have a Main report
called MainReport that has subreports on it and the Alcohol one that you
got
working is on it. So how do you do it for subreport because I have like 3
more that I have to do this with?
You can, but do remember, if those sub-reports have a relation (one to many)
to the main report, then you should only get those "many" records for the
main records that we restricted (by using our where clause). So, hopefully,
if you setup the link child/master fields, then restricting the records to
the main repot should restrict the records to the sub-report.
So, you *can* very well restrict the records in the sub-reports. Further, if
those sub-reports are to have the SAME restricting as the main report, then
again you an use the link master/child fields. (so, it might not be one to
a many, but a one to one).
So, hopefully, you have some means to relate those sub-reports to the main
report (for example, if the sub-reports need the SAME restrictions, and same
records as the main report, then simply use the link master/child fields in
the sub-report control by the primary key. This will result in the
sub-reports having the SAME filter as the main form.
If you need to filter each sub-report on a different criteria then the main
reports "where" filter, then the link master/child settings might not help
you (but, if you can't use the link master/child settings, then likely you
don't have a proper relation between the main and sub form anyway. So, you
*can* do this, but you can't use the "where" clause for the sub-forms. You
will actually have to set the sub-forms reocrdsouce in the open event of the
report.
So, clarify the above issue. Since setting the filter for the sub-forms is
easy, and automatic if you use the link master/child settings. (this also
means that your sub-reports queries don't need any parameters at all. If you
did/do have a bunch of parameters for the sub-reports, then can see now that
you done way too much work....and simply using a where clause for the main
reprot is the simple, and easy way to go....
Good luck, and do feel free to ask for more info on the above....