PC Review


Reply
Thread Tools Rate Thread

Conditional Query

 
 
Luis Marques
Guest
Posts: n/a
 
      23rd Jun 2009

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?
 
Reply With Quote
 
 
 
 
Klatuu
Guest
Posts: n/a
 
      23rd Jun 2009

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" wrote:

> 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?

 
Reply With Quote
 
Luis Marques
Guest
Posts: n/a
 
      23rd Jun 2009

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" wrote:
>
> > 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?

 
Reply With Quote
 
Piet Linden
Guest
Posts: n/a
 
      23rd Jun 2009
On Jun 23, 11:36*am, Luis Marques
<LuisMarq...@discussions.microsoft.com> wrote:
> 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".
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Query Frank Lim Microsoft Access 4 3rd Apr 2009 07:36 AM
conditional query shaqil Microsoft Excel Programming 0 21st Jul 2007 08:39 AM
Using query results within Conditional Statement...sequenced conditional queries rafael.farias.jr@gmail.com Microsoft Access 3 30th Aug 2006 02:08 PM
conditional query Astrotek Microsoft Access Getting Started 1 15th Feb 2005 10:33 PM
Conditional Query Ken Snell [MVP] Microsoft Access Queries 10 30th Jan 2005 10:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:59 PM.