ACPreview Problem

coyotemrh

New member
Local time
Today, 05:52
Joined
Sep 24, 2008
Messages
2
I am calling access from Visual Basic. If I run
DoCmd.OpenReport ReportName:="Report Name" then the report prints fine.

But, if I run
DoCmd.OpenReport ReporName:="Report Name",View:=Access.acPreview

then nothing seems to happen. There is no report opened in Prevew Mode.

If I bring up Access and bypass the Visual Basic front end, I can run the report by clicking on the report name and it comes up in preview mode.

Any ideas?

Thanks,

Michael.
 
How about using this syntax instead:

DoCmd.OpenReport "Report Name", acPreview
 
Thanks for the reply. Yes, I have already tried:

DoCmd.OpenReport "Report Name", acPreview

It does the same thing, just "goes away", or hangs up. I even put a message below the doCmd that displays ok, and I will "look" for an instance somewhere of the previdew going on. What is odd, is that if I take away the ,acPreview, the report prints just fine ...

And, if I write the code in the access module, and do not Invoke from Visual Basic, it works fine. Only when I have Visual basic front end the code, does the acpreview not work.

And, by the way, when Visual basic front ends all the other code I wrote in Access, all that code works fine. It is only the acPreview option!

Any other ideas?

thanks,

michael.
 

Users who are viewing this thread

Back
Top Bottom