Prev: Send different reports to different printers
Next: marvendas@gmail.com Kit completo deSolenóides ( solenoid ) + chicote Para Câmbio automatico hidramatico Audi A3 Vw Golf gti turbo 52023
From: gmazza via AccessMonster.com on 2 Mar 2010 13:58 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 2 Mar 2010 17:42
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 > > . > |