From: gmazza via AccessMonster.com on
As per my other posts, I need 3 combo boxes on my parameter form and I need
to be able to select ALL for either of them, or a combination of ALL and
other choices and have my report run with the correct data.
Can anyone lend me a hand to get this going?
I have it working for 1 but when I try for all 3 I am running into all kinds
of trouble. I did the same thing for the next 2 as I did for the first one
but it is not working.
Thanks in advance!

gmazza wrote:
>Thanks for your reply Karl! That worked. So what if I were to put 3 combo
>boxes on my parameter form, one for Description, Product, and Dosage. Is it
>possible to be able to choose All for all 3, or All for Description and an
>actual Product and Dosage from their respective tables and still have the
>data show up correctly?
>There are 9 different combinations for this so how could I go about writing
>that query.
>Assuming Product and Dosage are set up the exact same way as Description.
>Any thoughts?
>Thanks again!
>
>>Try now --
>>SELECT Study.Description, Study.Product, Study.Dosage
>[quoted text clipped - 18 lines]
>>> >>
>>> >> Please help, thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201003/1

From: Duane Hookom on
I typically use code to build a WHERE CONDITION for the docmd.openreport
method. IE:

Dim strWhere as String
strWhere = "1= 1"
If Me.txtDescription <> "ALL" Then
strWhere = strWhere & " AND [Description]=""" & Me.txtDescription & """ "
End If
If Me.txtProduct<> "ALL" Then
strWhere = strWhere & " AND [Product]=""" & Me.txtProduct& """ "
End If
If Me.txtDosage <> "ALL" Then
strWhere = strWhere & " AND [Dosage]=""" & Me.txtDosage & """ "
End If
DoCmd.OpenReport "rptYourRptName", acViewPreview, , strWhere

--
Duane Hookom
Microsoft Access MVP


"gmazza via AccessMonster.com" wrote:

> As per my other posts, I need 3 combo boxes on my parameter form and I need
> to be able to select ALL for either of them, or a combination of ALL and
> other choices and have my report run with the correct data.
> Can anyone lend me a hand to get this going?
> I have it working for 1 but when I try for all 3 I am running into all kinds
> of trouble. I did the same thing for the next 2 as I did for the first one
> but it is not working.
> Thanks in advance!
>
> gmazza wrote:
> >Thanks for your reply Karl! That worked. So what if I were to put 3 combo
> >boxes on my parameter form, one for Description, Product, and Dosage. Is it
> >possible to be able to choose All for all 3, or All for Description and an
> >actual Product and Dosage from their respective tables and still have the
> >data show up correctly?
> >There are 9 different combinations for this so how could I go about writing
> >that query.
> >Assuming Product and Dosage are set up the exact same way as Description.
> >Any thoughts?
> >Thanks again!
> >
> >>Try now --
> >>SELECT Study.Description, Study.Product, Study.Dosage
> >[quoted text clipped - 18 lines]
> >>> >>
> >>> >> Please help, thanks!
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201003/1
>
> .
>