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!

Running Reports

Status
Not open for further replies.

dwesnyc

Technical User
Nov 24, 2006
14
US
Hello,

I have an access database in access 2000. I have a variety of letters(reports) that are run in it. Here is my set up:

A command button on a form linked to a macro
The macro opens 6 reports(the letters)
There is a filter in the report that says yesnoboxinquery=True

What happens is the reports only pull data for which every yes no field there is. It works great. The problem is when there is no True. The report still comes up but has "error" in all the merge fields.

So I want to change the command box so that if the yesnoboxinquery=true Then it will open the report. It won't even try to open the report if there is no data for it.

How do I do that? Right now I have docmd.openreport(reportname). How do I get a If/Then that looks in a query for the true/false data.
 
Let me expalin the query. Its basically data with 6 yes no boxs for each letter. SO for instance it would be

Name | Address | yesnoletter1 | yesnoletter2 | yesnoletter3

So report1 looks for any person with the yesnoletter1 box clicked to yes. So if 10 people are in the system and 2 are clicked yes only 2 pages of the report come up. The problem is when there are 0 people with a yes. Then the report still prints one page, but with all errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top