Opening reports with filters with docmd.openreport 
Author Message
 Opening reports with filters with docmd.openreport

Here is a problem I ran into when I converted my database from 2.0 to 97.

I have a report based on table TableX. Using code I make a table called
tblTemp using a make table query that has the same fields as tableX.

In access 2.0 When I executed
docmd openreport , ReportName, A_PREVIEW, "tblTemp"
it opened the report and based it on the tbltemp table everythign was hunky
dory.

In access 97 when I execute
docmd.openreport reportname,acPreview,"tblTemp"
It does not work

Anybody know why?

------------------------------------------------------
             Tim Uckun

      Mobile Intelligence Unit.
------------------------------------------------------
   "There are some who call me TIM?"
------------------------------------------------------



Fri, 21 Jul 2000 03:00:00 GMT  
 Opening reports with filters with docmd.openreport

The string argument at the end of the DoCmd in both Access 95 and 97 is a
filter passed to the underlying query as a WHERE clause with out the word
WHERE. So what you could do in 2.0 Now end up in a query as "WHERE tblTemp"
a no-go in a query you will now need to base that report on the make table
query ( changing it to a select query) and call it accordingly without the
string.

Andrew

Quote:

>Here is a problem I ran into when I converted my database from 2.0 to 97.

>I have a report based on table TableX. Using code I make a table called
>tblTemp using a make table query that has the same fields as tableX.

>In access 2.0 When I executed
>docmd openreport , ReportName, A_PREVIEW, "tblTemp"
>it opened the report and based it on the tbltemp table everythign was hunky
>dory.

>In access 97 when I execute
>docmd.openreport reportname,acPreview,"tblTemp"
>It does not work

>Anybody know why?

>------------------------------------------------------
>             Tim Uckun

>      Mobile Intelligence Unit.
>------------------------------------------------------
>   "There are some who call me TIM?"
>------------------------------------------------------



Sat, 22 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reports Not Maximized on docmd.OpenReport

2. Reports - cancel of DoCmd OpenReport not working

3. DoCmd.OpenReport

4. docmd.openreport

5. Limit DoCmd.OPenReport to print first three pages

6. docmd.OpenReport

7. Help with DoCmd.OpenReport

8. doCmd.OpenReport-How to call from VB with Parameters

9. Access 97 problem on using OpenReport with Filter query

10. DoCmd.RunCommand acCmdSaveRecord DoCmd.RunCommand acCmdSaveRecord

11. DoCmd.Open.Query in Module!

12. fail to open recordset for a new table created from docmd.copyobject

 

 
Powered by phpBB® Forum Software