Can't see an instanced Report. Really need Advice

  • Thread starter Thread starter Edgar
  • Start date Start date
E

Edgar

Hi Everyone,
I got this problem:

Public MyReport as Report
set MyReport = Report_Volume

and Now,
DoCmd.OpenReport MyReport, acViewPreview, Criteria
But It doesn't show anything.
I added -- MyReport.Visible = true -- and then it shows the report
Without
any Filtering. It Shows the report in he original State Exactly as
Report_Volume looks like.
I Think MyReport.Visible = true is giving me a trouble opening the
source report (Report_Volume). What I need is to know Why MyReport doesn't
show up with the Docmd order.

Please, help is required for half a Day of no resolutions

Thanks a lot for your considerations.
 
Use

MyReport = "Report_Volume"

Since you don't have quotes around Report_Volume, Access assumes it's a
variable. The fact that you don't get an error implies that you haven't told
Access to require that all variables be defined. The first line of each
module should be

Option Explicit

You could have saved yourself a half-day of frustration!
 
Hi Edgar,

Why are you using the following two lines of code?
Public MyReport as Report
set MyReport = Report_Volume

Try it after commenting out these lines and changing it as follows:

DoCmd.OpenReport "Report_Volume", acViewPreview, , "Criteria"

where "Criteria" is a string expression that's a valid SQL WHERE clause
without the word WHERE.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
Hi Doug,
The first line of each module should be
Option Explicit

I think this is usually the second line of code:

Option Compare Database
Option Explicit
You could have saved yourself a half-day of frustration!

Agreed.
Edgar: Have a look at this "gem tip":

Always Use Option Explicit
http://www.access.qbuilt.com/html/gem_tips.html#VBEOptions


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
Back
Top