Report Parameter not displaying correct results

Hey there,
I have a parameter form that you can choose a Description from or ALL. Its
based on this query:
SELECT Description, 1 AS SortColumn FROM Study UNION SELECT "All", 0 FROM
Study
ORDER BY SortColumn, [Description];

When I choose ALL I get no data on my report when there is data.

MY RecordSource for the report is:
SELECT Study.Description, Study.Product, Study.Dosage 
FROM Study 
WHERE ((Study.Description)=forms!SelectTrial!txtDescription) 
OR((forms!SelectTrial!txtDescription)="ALL")

If I choose ALL shouldn't all my Descriptions show up on the report or am I
doing something wrong?

Please help, thanks!

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

0
gmazza
2/18/2010 11:04:36 PM
access.reports 4434 articles. 0 followers. Follow

6 Replies
865 Views

Similar Articles

[PageSpeed] 43

Your "All" is text and not a function so it won't work that way.
I do not know why you need the first query but change the second to this --
SELECT Study.Description, Study.Product, Study.Dosage 
FROM Study 
WHERE ((Study.Description)=forms!SelectTrial!txtDescription) 
OR (Study.Description like IIF(forms!SelectTrial!txtDescription)="ALL", "*",))

-- 
Build a little, test a little.


"gmazza via AccessMonster.com" wrote:

> Hey there,
> I have a parameter form that you can choose a Description from or ALL. Its
> based on this query:
> SELECT Description, 1 AS SortColumn FROM Study UNION SELECT "All", 0 FROM
> Study
> ORDER BY SortColumn, [Description];
> 
> When I choose ALL I get no data on my report when there is data.
> 
> MY RecordSource for the report is:
> SELECT Study.Description, Study.Product, Study.Dosage 
> FROM Study 
> WHERE ((Study.Description)=forms!SelectTrial!txtDescription) 
> OR((forms!SelectTrial!txtDescription)="ALL")
> 
> If I choose ALL shouldn't all my Descriptions show up on the report or am I
> doing something wrong?
> 
> Please help, thanks!
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-reports/201002/1
> 
> .
> 
0
Utf
2/19/2010 12:06:01 AM
I'm getting syntax errors with your query.
I took out an extra ) in the last line but it still errored. I deleted the
last comma, and it still said the same thing. Says syntax error (comma) in
query expression.

As for my first query, I added it because I want the combo box to display the
records, as well as ALL, so the user can choose the a description or choose
ALL to return all descriptions.
Thanks!

KARL DEWEY wrote:
>Your "All" is text and not a function so it won't work that way.
>I do not know why you need the first query but change the second to this --
>SELECT Study.Description, Study.Product, Study.Dosage 
>FROM Study 
>WHERE ((Study.Description)=forms!SelectTrial!txtDescription) 
>OR (Study.Description like IIF(forms!SelectTrial!txtDescription)="ALL", "*",))
>
>> Hey there,
>> I have a parameter form that you can choose a Description from or ALL. Its
>[quoted text clipped - 15 lines]
>> 
>> Please help, thanks!

-- 
Message posted via http://www.accessmonster.com

0
gmazza
2/19/2010 4:03:24 PM
Try now --
SELECT Study.Description, Study.Product, Study.Dosage 
FROM Study 
WHERE (Study.Description = [forms]![SelectTrial]![txtDescription]) OR 
(Study.Description like IIF([forms]![SelectTrial]![txtDescription] = "ALL", 
"*",));

If you still get syntax error remove part of WHERE statement like this --
SELECT Study.Description, Study.Product, Study.Dosage 
FROM Study 
WHERE (Study.Description = [forms]![SelectTrial]![txtDescription]); 
     or this --
SELECT Study.Description, Study.Product, Study.Dosage 
FROM Study 
WHERE  (Study.Description like IIF([forms]![SelectTrial]![txtDescription] = 
"ALL", "*",))

-- 
Build a little, test a little.


"gmazza via AccessMonster.com" wrote:

> I'm getting syntax errors with your query.
> I took out an extra ) in the last line but it still errored. I deleted the
> last comma, and it still said the same thing. Says syntax error (comma) in
> query expression.
> 
> As for my first query, I added it because I want the combo box to display the
> records, as well as ALL, so the user can choose the a description or choose
> ALL to return all descriptions.
> Thanks!
> 
> KARL DEWEY wrote:
> >Your "All" is text and not a function so it won't work that way.
> >I do not know why you need the first query but change the second to this --
> >SELECT Study.Description, Study.Product, Study.Dosage 
> >FROM Study 
> >WHERE ((Study.Description)=forms!SelectTrial!txtDescription) 
> >OR (Study.Description like IIF(forms!SelectTrial!txtDescription)="ALL", "*",))
> >
> >> Hey there,
> >> I have a parameter form that you can choose a Description from or ALL. Its
> >[quoted text clipped - 15 lines]
> >> 
> >> Please help, thanks!
> 
> -- 
> Message posted via http://www.accessmonster.com
> 
> .
> 
0
Utf
2/19/2010 5:14:01 PM
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!

KARL DEWEY wrote:
>Try now --
>SELECT Study.Description, Study.Product, Study.Dosage 
>FROM Study 
>WHERE (Study.Description = [forms]![SelectTrial]![txtDescription]) OR 
>(Study.Description like IIF([forms]![SelectTrial]![txtDescription] = "ALL", 
>"*",));
>
>If you still get syntax error remove part of WHERE statement like this --
>SELECT Study.Description, Study.Product, Study.Dosage 
>FROM Study 
>WHERE (Study.Description = [forms]![SelectTrial]![txtDescription]); 
>     or this --
>SELECT Study.Description, Study.Product, Study.Dosage 
>FROM Study 
>WHERE  (Study.Description like IIF([forms]![SelectTrial]![txtDescription] = 
>"ALL", "*",))
>
>> I'm getting syntax errors with your query.
>> I took out an extra ) in the last line but it still errored. I deleted the
>[quoted text clipped - 18 lines]
>> >> 
>> >> Please help, thanks!

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

0
gmazza
2/19/2010 9:53:20 PM
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

0
gmazza
3/2/2010 6:58:06 PM
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
> 
> .
> 
0
Utf
3/2/2010 10:42:05 PM
Reply:

Similar Artilces:

Need more Reports
GP does not provide detailed reports itself. reports such as sales by customer, best selling items, inventory valuation and so... Also the reports that it provides are not in good design and format (not useful). Is there any report package from third party that can be purchased or there is any other solution to get in depth reports and analysis? Sure Since Great Plains cannot possibly be all things to all people, get to know the layout of the Great Plains database and where all of the data is stored. Then roll your own reports using the native Report Writer, SQL Reporting Services, Cryst...

Customized CRM Report with Reporting Services
I have written a customized report in Reporting Services using SQL Server 2005. I need to use a date as one of my query parameters. I am using three parameters, one being UserName, 2) Customer, and 3) Date. I want the report to filter on the username, then customer, then date in order to provide a specific report for 1 customer and 1 date only. I changed the select for the date to: Select Distinct Convert (varchar, new_tripdate,101) in order to cut the time out of view. When I run the report, I first select the username, then I am provided with a list of customers for that user, but the...

W-2 Tax Reporting Figures Not Accurate
I use Money to monitor all of my financial situations. This year, I decided to see how it did with supplying tax information. "Poorly" is the answer. I would expect the 'Tax Line Manager / W-2 / Your salary' and the 'Tax Software Report / W-2 / Your salary' to show a figure that matches my 'W-2 / Box 1' statement information. They do not. The reason is that the 'W-2 / Box 1' statement figure has pre-tax retirement contributions subtracted from the wages. When I enter my paycheck information into Money, I categorize retirement contributions no...

Text from table won't display
Hi everyone, thanks for being so helpful. I'm working on a report and included is a text box whose control source is from the table I've queried. The actual data from the table isn't showing up on the report when I open it, though. And it's only this text field. Other text fields work fine and my date fields also show up fine. I've made sure that I included this column in the query, but nothing I do makes the data appear. Please help. Set the control's border to red, do you see this in preview? What section of the report contains the control? -- Duane Hookom Micro...

Sales Report #3
Hi All Is there any sales report to show detailes like Store-total Sales-Cash Sales-Credit-Span-customer- Change Item/customer -Discount. Cash Sales-Credit-Span: is tender type. Change Item/customer : like one customer change item and total amount for backing item 200$ (e.g). Is there any one he have report like that? Thanks for help M. Own ...

find text, display text
I want to find text within a cell and, if found, display a text message of my choosing. For instance, if A1 has the txt "Special Price", then I want B1 to say, "Special." If it says "Regular Price", I want B1 to say "Reg." Thanks! Hi you may have a look at VLOOKUP (together with a lookup table). See: http://www.contextures.com/xlFunctions02.html -- Regards Frank Kabel Frankfurt, Germany "shaun" <shaun@discussions.microsoft.com> schrieb im Newsbeitrag news:F55C22DF-F71D-4261-A4D8-91DA409F4989@microsoft.com... > I want to find tex...

Blank networth reports
Hi, Whenever I run the net worth reports, I get the hourglass for a second or two, then loading but it never renders. Other reports (Transactions, loans, cap gains, etc.) run fine. I converted from Quicken. In microsoft.public.money, <anonymous@discussions.microsoft.com> wrote: >Hi, Whenever I run the net worth reports, I get the >hourglass for a second or two, then loading but it never >renders. Other reports (Transactions, loans, cap gains, >etc.) run fine. Perhaps customize the report to a different time frame, and then reset the report? Tried all dates. >...

eXtender SOP Reports
Hello. We are using a modified version of the eXtender SOP Blank Packing Slip Form. It was modified years ago by an outside consultant. For the first time, we need to use the "Print Customer Item" option, and notice this does not work on our modified report (it works fine on the non-modified version of the same eXtender report). I am being a little lazy here and hoping someone can tell me how to turn this "feature" off or on in modifier :) Thank you, in advance. M. ...

Reports are not being shown MM07
Hi, pals! When I try to see the Monthly Reports (any month) in MM07, I get a popup saying: ------------------------------------------------------------- "File Download Do you want to open or save this file? Name: moneygen.htm Type: Firefox Document, 1,03KB From: C:\Users\yadayada [open] [Save] [Cancel] -------------------------------------------------------------- If I click OPEN, it opens the report in Firefox (!), while the Money windows says: "Navigation to the webpage was canceled. What you can try: - Retype the address" Anyone has seen it before? How to make Money o...

#Name? prints on a report when date shows up on preview
Access 2003 SP 2 Windows XP SP 2 I have created a report (rptFuelmanByForeman) that is based on a Query (qryFuelmanByForeman). I have created a form to select (or enter) a date range that then filters the report based on that date range and populates transactions between those dates. I have created two text boxes on the report that display the start date (txtStartDT) and end date (txtEndDT) entered in the date select form. The control source on the date boxes on the report is "=Forms.frmFuelmanByForeman.txtEndDate" & "...txtStartDate". In Preview mode, the dates d...

display in picture box.
hi, I wanted you to share your time for my project work. I have an array of data(avi video stream).I want it to be displayed as an image in a picture box.I read frame by frame data and have it as an array.To what type of image should I convert the data and display each frame and look like a movie.I want this to be done as an event of mouse click.So what shall i do.Where would i get the source code for the above problem.I also want to display the frames of other type of video files.I dont know any information about other video files.what are the other video format files that can be don...

I need 19:00
My sheet shows tool down times for a works project A1 = 19:00 (in time format) B1 = 7:00 (in time format) C1 = =B1-A1 which displays ############# How do i minus time after 00:00 0:00 If i take 19:00(B1) from 19:01(C1) it gives me the correct answer of 0:01, its just with numbers after 00:00. The WinXL default 1900 date system can't show negative times (times are stored as fractional days, so 19:00 = 0.791666667). The (Mac default) 1904 date system (Tools/Options/Calculation, check the 1904 date system checkbox) can, but the result would be -12:00 One solution would be to add 1 ...

In a report, is there any way a record will change color if it's different from the previous record
Hi, I am working on a project where I need to color code the report so it will distinguish if the previous record is different from the current record. Because the record will have many similar record, so I am trying to group the record so it's easier to look. In a report, is there any way a record will change color if it's different from the previous record. Thanks for your help. richiecheng@gmail.com wrote: >Hi, I am working on a project where I need to color code the report so >it will distinguish if the previous record is different from the >current record. Because...

Saving Reports
Hi, Is there a simple way to save advanced reports for use on a monthly or weekly basis. I can produce a dynamic report but can't find a way to save this as a template so it can be run on a regular basis. Having to select all the criterea each time you want to run the report is a little annoying, I must be missing something here...? Thanks Nik Once you select all the required criteria for your search, you could click on the 'Save As' button to save the search results with some specific names. For other users to view this search result, go to the 'Saved Views' tab, ...

Crosstab Query results/ Sum
I created a crosstab query that outputs sales by each month (month as a column header). I am creating a second query to retrieve sums of the months I am interested. Let's say the sales is as follows Month1 Month2 Month3 $200 $100 $300 Here is the formula I am using: Last3Months: Month1 + Month2 + Month3 Instead of getting the sum which shoudl be $600, it looks like the formula is concatenating the values resuting in 200100300 i guess i can just sum it up in Excel but wanted to see if i can do it in Access. Based on what you posted, it looks l...

Launching Reports from the Submit Order Button in 4.0
My client has several retail locations and they are using CRM in conjunction with their POS system. Therefore, CRM Orders has received a lot of customization to make it as slim, trim, and "Mouse-Click-Free" as possible. In the spirit of reducing even more mouse clicks, they have asked if we could launch a custom report (Basically the Order Report, renamed "Order Receipt") when the "Submit Order" button (re-named by Scribe's CRM to GP Integration) is clicked. The Receipt would render and then be printed for the cusomter. The report is context sensitive...

Insert row, table to table
Hi, As I cannot use INSERT INTO with values specified to WHERE. I have created an interim temporary table where the record contains two text strings.Now I want to be able to take those text strings and append to the correct table where the record is set by an ID number. First_Name = Fred Last_Name = Jones Its a new contact so it is too be added to a customer with an ID = 1375 Now I can't use the following sql statement strsql = "INSERT INTO [tblCUSTCONTACTS] ( [FIRST_NAME], [LAST_NAME] ) " _ & " VALUES (""" & strFirst & "&...

To view, specifically Units in one report
I have report with a Reporting Tree (9 Unit), when the report is generated, I select only two unit, but I need that the drill down show one report with these unit only If you want multiple units in a single report you will need to use the column layout with unit restrictions on multiple columns Leslie "Pedro" wrote: > I have report with a Reporting Tree (9 Unit), when the report is generated, I > select only two unit, but I need that the drill down show one report with > these unit only Leslie; Each Column layout have the unit restrictions Thanks :-) "Lesl...

how to split data into columns and arrange the resulting data
I have data in cells A2, A3 and A4 as below: 1, 2, 4, 5, 7, 8 1, 2, 3, 4 2, 3, 4 I want to split into columns (which I did using Data > Text to Columns option). But I also want the data to "automatically" fall under appropriate heading (1, 2, 3, 4, 5, 6, 7, 8) which are in respecive cells A1:H1. Thank you in advance How about an alternative: With your data in A2:Axx, put this formula in B2: =","&SUBSTITUTE(A2," ","")&"," Then B2 will look like: ,1,2,4,5,7,8, Then put this in C2 and drag across as far as you need. =IF...

small business reports ...
Dear all Hope this is the right group. Can Mone 2002 create a Trial Balance report? Is there a list of reports availabe in 2006 (Small Business edition) that is accessible somewhere, as I have not been able to locate any such list, and is a Trial Balance one of them. While I am happy using Money and have been for some time, when it comes to reviewing my files the person doing so is a certified accountant and Quick Books user and would like me to convert, I have continued to resist however he continues to press for these accounting reports. Can Money 2002 and or 2006 Small Business ...

Reporting Error ==> very urgent
Hi All, We have installed CRM 4.0 for our organization. We ahd our CRM and SQL on different servers and decided to use Mcirosoft Outlook client. The problem is when we try to generate reports we are unable to get any reports. We always getting an error stating "REPORTING ERROR REPORT CANT BE DISPLAYED" it also stats that to contact Microsoft for details. We are struck with this error for 3 days and the issue is bulging in alarming propositions. Kindly advice me to resolve and overcome this issue. Thanks a lot in advance. elays - ...

Report writer
Hello, I am trying to add the transaction distribution details onto a copy of the PM Blank Document in Report Writer in GP 9. Would you pls advise as I can add the fields containing the data but the data is not appearing on the report. Thanks your comments are appreciated. -- chj@jup Once you were done modifying the report, did you give access to the mdoified report under Security? -- Lyle U chj wrote: > Hello, > > I am trying to add the transaction distribution details onto a copy > of the PM Blank Document in Report Writer in GP 9. Would you pls > advise as I c...

Loan Accounts in Reports
Bugs are in reports, the loan that I pay to my car is divided in 2, principal and interest, but in reports I can't show the two at same time, the reports show only the interest that I'm paying. The budget have the same problem with loans, it shows values that don't exists, I start a new budget, put all the values correctly and finalize it, when I go to budget home there are values that I not put there. There is some fix to those bugs? ...

Modified Case Form Does Not Display
It wasn't very difficult to add new objects to the schema and to create a new tab with new fields on the Case form. However, I've not been able to see the new tab and fields when I bring up either a new or view form. Is there a trick to making this work? Thanks, Phil. Thanks to Alex Polkhovsky who previously answered this question on 8/21, better to search before posting. Thanks. >-----Original Message----- >It wasn't very difficult to add new objects to the schema >and to create a new tab with new fields on the Case >form. However, I've not been able t...

Monthly reports in Money 2004 Standard
Is there a way to customize the categories used to compose the Monthly Reports? I would like to omit my business travel and living expenses from these reports, as they are fully reimbursed, and have nothing to do with my household finances. Can this be done in 2004? If not, has this feature been rolled into newer versions? Monthly reports are not customizable in any version of Money that is in the wild. "bob2246" <bob2246@discussions.microsoft.com> wrote in message news:3493CA51-596F-4D59-9540-F2D79EA5A618@microsoft.com... > Is there a way to customize the categor...