Conditional Query

  • Thread starter Thread starter Luis Marques
  • Start date Start date
L

Luis Marques

I have a conditional query [DATA] that feeds two reports.

That query has a field where I specified the repont I want to open (Report1
or Report2).

I need a code to do this?
 
It doesn't work that way.
You have to open the report using the OpenReport action or method.

The only way to do that would be to use a DLookup or a query to determine
the report name contained in the data, then open that report. This you could
do in VBA, but I would advise against such a design. It would make
troubleshooting more difficult.
 
In that case, how would be the code?

"Klatuu" escreveu:
It doesn't work that way.
You have to open the report using the OpenReport action or method.

The only way to do that would be to use a DLookup or a query to determine
the report name contained in the data, then open that report. This you could
do in VBA, but I would advise against such a design. It would make
troubleshooting more difficult.

--
Dave Hargis, Microsoft Access MVP


Luis Marques said:
I have a conditional query [DATA] that feeds two reports.

That query has a field where I specified the repont I want to open (Report1
or Report2).

I need a code to do this?
 
I have a conditional query [DATA] that feeds two reports.

That query has a field where I specified the repont I want to open (Report1
or Report2).

I need a code to do this?

If you have one query that is the basis for two different reports, you
might be able to just use one query and then add the filter in the
Open event of the report.

See DoCmd.OpenReport

One of the arguments is the filter, which is just a WHERE clause
without the keyword "WHERE".
 
Back
Top