Report-Preview from VB.

S

Shreenivas Potnis

No this does not work. It does show that the report is in
openstate, but the report-preview is not visible.

-------------------------------------

Subject: Re: Report preview through VB6
From: "SA" <[email protected]> Sent: 1/19/2004
2:24:14 PM
Actually it does preview the report, (you have to use the
value for the
constant rather than acPreview, because VB doesn't know
what that constant
is,) but the problem is that because your code simply runs
to the next line
which may close the report or close Access, you need to
add a little loop to
pause your code while the report is open as in:

Const acViewPreview = 2
Const acSysCmdGetObjectState = 10
Const acReport = 3
Const acObjStateOpen = 1

App.DoCmd.OpenReport "YourReport", acViewPreview
While App.SysCmd(acSysCmdGetObjectState,
acReport, "YourReport") =
acObjStateOpen
DoEvents
Wend
App.Quit

HTH
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

"Shreenivas Potnis" <[email protected]>
wrote in message
DoCmd.OpenReport "MyReport", acPreview
does not give the report preview when executed through VB6.

However acNormal prints the reports to the printer.

How to obtain the report-preview through VB?


..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top