Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you print a report with only "Yes" response

Status
Not open for further replies.

Neup44

Technical User
Jun 10, 2004
22
0
0
US
I have a 3 tables with 3 items in each table. Each item in each table has a check box (yes or no).

I have a query pulling the information from the 3 tables (total of 9 items). I have a report that is based on the information in the query. Here's my problem, when I print my report, all 9 items are printed when I only want to print the yes or check items. Please help
 
You need to tell Access what you want. In the report properties, look for the filter property on the data tab. If you're using docmd.openreport, you can include the filter or where arguments.


Randy
 
randy700,

Thank you very much for your response. It's been a while since I last used Access so I could use some more help.

Here is what I did:
Report
Right click on Text box
Select Properties
Sekect Data Tab
and the only selection I have is Control Source and Triple State.

Then I
Quuery
Design
Right click and select properties
and the only two options are General and Lookup.

jneup44



When I go to the report, design, right click on the text box, select properties
 
There are several ways to go about doing this. The easiest would be to design your query to only produce the results you want in the report. On the criteria line... Yes (or you can use True or -1).

If you don't want to filter the query, you can include the where clause in the openreport call...
DoCmd.OpenReport "ReportName", acViewPreview,,"FieldName = -1"

Randy
 
randy700,

Thanks again for the information. I did try the Yes on the criteria line (for every item) but when I did this and re-ran the query, only those entries that had Yes for all the entries were displayed. That is, if I have 5 boxes and 10 entries, by putting Yes on the criteria line for all 5 boxes, then only thoses entries that have all 5 boxes check will be displayed. What I want is to print a report that will print each item and only those boxes that were checked yes.

Again, thanks for all your help.

Neup44
 
OK, now I see what you're trying to do. How about this...

SELECT Product, iif(InStock= -1, "InStock", "") AS F2, iif(Discontinued= -1, "Discontinued", "") AS F3, iif(HighCostItem= -1, "High Cost", "") AS F4, iif(SpecOrd= -1, "Special Order", "") AS F5 FROM TableName

Your results will look something like:
1st product InStock
2nd product InStock HighCost SpecialOrder
3rd product Discontinued
4th product High Cost
etc




Randy
 
randy700


I will give it a try and let you know the results (may not have the opportunity to try it out until tonight). Again, thanks for your help.

Have a great day.

Neup44
 
randy700

I started doing what you recommended but then I relized that may not get the results I was looking for.

Here is the application. A construction company builds houses and when they sell a house, the house is under warranty for 12 months. That is, if something is wrong, the construction company will fix it. What I was doing was developing a data base to collect the data and then print out a report to give to the repair man. The table will have many items like Roof repair, plumbing repair, flooring repair, etc. What I want my report to identify is what items need to be repaired. For example:

Lot 123
Roof Repair yes (or just a check is okay)
Flooring Repair yes (or just a check is okay)


I will also have a block in which a more detail description can be typed (roof is leaking in master bedroom). In this expample, since no plumbing repair was checked, no plumbing repair was listed on the report.

I hope this helps. I do appreciate your help and any input you can give me.


Neup44
 
SELECT * FROM tblYourTable WHERE Lot = 123

Query results:
Lot 123
Roof Yes
Floor Yes
Plumb No

Report:
Lot: 123
_
|_| Roof Repair (box is checked)
_
|_| Flooring (box is checked)
_
|_| Plumbing (box is not checked)



Randy
 
Randy,

All looks good except I don't want the plumbing box to appear on the report. Only those boxes that were checked or if a text box, only if something was entered.

Report.
Lot 123

Roof Repair Yes or a checked box

Repair Description "The roof is leaking in the master bedroom."

Flooring Repair Yes or a checked box

End of report.

The problem, I will have many repair items that can be checked but most of the time, a customer will have only 1 to 6 items checked. If the report prints out each repair, then each reports will have 10 pages of repair items with only 1 to 6 items checked. What I would like to do is have a report that only identifies those repair items that have been checked.

Randy, you're been very helpful and I'm very appreciative your time and effort.

Neup44
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top