From: Tara on
I need to find a way that users can click on a button to begin running a
report, have a form pop up that allows them to set criteria for whatever
report they chose, and then continue to that report. I have all the pieces
in place including the form that pops up (frmCriteria) and pauses the code so
the user can set the criteria. The problem I'm having is that the reports
each require frmCriteria be open in order to determine which RecordSet to
use. Because frmCriteria is opened as Dialog, it must be closed in order to
resume the code. So, I can suspend the code, but I can't start it again (by
closing frmCriteria) because then the report doesn't get the correct
RecordSet.

Any ideas as to how to overcome this?
From: Jeff Boyce on
Tara

Instead of instigating the report first, then popping open the criteria
form, how about popping open the form first, then adding a "Do It" button on
that form that actually opens the report?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Tara" <Tara(a)discussions.microsoft.com> wrote in message
news:E33A627F-88B1-4F92-8A4C-5A08B013629B(a)microsoft.com...
>I need to find a way that users can click on a button to begin running a
> report, have a form pop up that allows them to set criteria for whatever
> report they chose, and then continue to that report. I have all the
> pieces
> in place including the form that pops up (frmCriteria) and pauses the code
> so
> the user can set the criteria. The problem I'm having is that the reports
> each require frmCriteria be open in order to determine which RecordSet to
> use. Because frmCriteria is opened as Dialog, it must be closed in order
> to
> resume the code. So, I can suspend the code, but I can't start it again
> (by
> closing frmCriteria) because then the report doesn't get the correct
> RecordSet.
>
> Any ideas as to how to overcome this?


From: Tara on
Unfortunately, that won't work. Several different reports use this same form
to set the same criteria.

I suppose I could put multiple buttons on the form, one for each report, but
I was hoping there was maybe just some code that I could use with a single
command button to resume the code that called the frmCriteria to begin with.

"Jeff Boyce" wrote:

> Tara
>
> Instead of instigating the report first, then popping open the criteria
> form, how about popping open the form first, then adding a "Do It" button on
> that form that actually opens the report?
>
> Regards
>
> Jeff Boyce
> Microsoft Access MVP
>
> --
> Disclaimer: This author may have received products and services mentioned
> in this post. Mention and/or description of a product or service herein
> does not constitute endorsement thereof.
>
> Any code or pseudocode included in this post is offered "as is", with no
> guarantee as to suitability.
>
> You can thank the FTC of the USA for making this disclaimer
> possible/necessary.
>
> "Tara" <Tara(a)discussions.microsoft.com> wrote in message
> news:E33A627F-88B1-4F92-8A4C-5A08B013629B(a)microsoft.com...
> >I need to find a way that users can click on a button to begin running a
> > report, have a form pop up that allows them to set criteria for whatever
> > report they chose, and then continue to that report. I have all the
> > pieces
> > in place including the form that pops up (frmCriteria) and pauses the code
> > so
> > the user can set the criteria. The problem I'm having is that the reports
> > each require frmCriteria be open in order to determine which RecordSet to
> > use. Because frmCriteria is opened as Dialog, it must be closed in order
> > to
> > resume the code. So, I can suspend the code, but I can't start it again
> > (by
> > closing frmCriteria) because then the report doesn't get the correct
> > RecordSet.
> >
> > Any ideas as to how to overcome this?
>
>
> .
>
From: fredg on
On Thu, 25 Feb 2010 07:20:01 -0800, Tara wrote:

> I need to find a way that users can click on a button to begin running a
> report, have a form pop up that allows them to set criteria for whatever
> report they chose, and then continue to that report. I have all the pieces
> in place including the form that pops up (frmCriteria) and pauses the code so
> the user can set the criteria. The problem I'm having is that the reports
> each require frmCriteria be open in order to determine which RecordSet to
> use. Because frmCriteria is opened as Dialog, it must be closed in order to
> resume the code. So, I can suspend the code, but I can't start it again (by
> closing frmCriteria) because then the report doesn't get the correct
> RecordSet.
>
> Any ideas as to how to overcome this?

regarding ... Because frmCriteria is opened as Dialog, it must be
closed in order to resume the code ...

Not true.
Instead of closing the form simply code that command button to make
the form not visible:
Me.Visible = False

Then the report will still have access to the form data and the report
will open.
Close the form in the Report's Close event:
DoCmd.Close acForm, "frmCrriteria"

The method I use is to first open the report.
In the report's Open event I open the frmCriteria in dialog:
DoCmd.OpenForm "frmCriteria", , , , , acDialog

Then I would continue as I suggested above, making the form not
visible and then closing it when the report closes.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
From: Jeff Boyce on
Tara

When faced with a similar issue (multiple reports, some of them potentially
using the same criteria ... or not), here's the solution I came up with.

* create a table that contains the Access report names, user-friendly
report names, and descriptions
* create a form with a combobox allowing selection of a report
* on that form, add selection criteria controls
* on that form, add a SINGLE command button that opens a report

?Which report? The one selected in the combobox!

The DoCmd.OpenReport command includes syntax to allow for a where
clause/filter ... which I build dynamically, "behind the form", based on the
selection criteria, and controlled by that single command button.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Tara" <Tara(a)discussions.microsoft.com> wrote in message
news:48863B08-7460-49D0-9C1B-D81A1650D6A5(a)microsoft.com...
> Unfortunately, that won't work. Several different reports use this same
> form
> to set the same criteria.
>
> I suppose I could put multiple buttons on the form, one for each report,
> but
> I was hoping there was maybe just some code that I could use with a single
> command button to resume the code that called the frmCriteria to begin
> with.
>
> "Jeff Boyce" wrote:
>
>> Tara
>>
>> Instead of instigating the report first, then popping open the criteria
>> form, how about popping open the form first, then adding a "Do It" button
>> on
>> that form that actually opens the report?
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Access MVP
>>
>> --
>> Disclaimer: This author may have received products and services mentioned
>> in this post. Mention and/or description of a product or service herein
>> does not constitute endorsement thereof.
>>
>> Any code or pseudocode included in this post is offered "as is", with no
>> guarantee as to suitability.
>>
>> You can thank the FTC of the USA for making this disclaimer
>> possible/necessary.
>>
>> "Tara" <Tara(a)discussions.microsoft.com> wrote in message
>> news:E33A627F-88B1-4F92-8A4C-5A08B013629B(a)microsoft.com...
>> >I need to find a way that users can click on a button to begin running a
>> > report, have a form pop up that allows them to set criteria for
>> > whatever
>> > report they chose, and then continue to that report. I have all the
>> > pieces
>> > in place including the form that pops up (frmCriteria) and pauses the
>> > code
>> > so
>> > the user can set the criteria. The problem I'm having is that the
>> > reports
>> > each require frmCriteria be open in order to determine which RecordSet
>> > to
>> > use. Because frmCriteria is opened as Dialog, it must be closed in
>> > order
>> > to
>> > resume the code. So, I can suspend the code, but I can't start it
>> > again
>> > (by
>> > closing frmCriteria) because then the report doesn't get the correct
>> > RecordSet.
>> >
>> > Any ideas as to how to overcome this?
>>
>>
>> .
>>