[AccessD] Detecting when an Access Report has been closed!

MartyConnelly martyconnelly at shaw.ca
Thu Mar 18 20:08:54 CST 2004


You might try something like this
'Here 's a thought. Instead of adding code to the report, why not just test
'for the "Open" state of the report. Add this to your code AFTER it opens
'the Report stDocName: borrowed this from Roger Carlson

DoCmd.OpenReport stDocName, acViewNormal
'
Do While SysCmd(acSysCmdGetObjectState, acReport, stDocName)
DoEvents
Loop
'
MsgBox "report Done"
'The Do Loop will check to see if your report (held in the stDocName
'variable) is open. Once it is closed, it will fall through the loop and the
' you can check what you want

Dick Abo wrote:

> 
>I have a form from which the user views a report in Print Preview mode by clicking the View Report button.  I would like user to respond to the question to Publish, or Not Publish the report after the report is viewed.  If the user decides to Publish the report, I export the report to Word and then save it in Ascii format (MS-DOS text w/layout).  
>
>I could incorporate a separate button on the form that just generates the Access 2000 report in acPreview mode.  I would prefer to detect when the report has been closed by the user so that I can then ask the question, 
Publish or Not Publish
 the report and to execute the remaining code that is behind the existing View Report button?  
>
>Can you kindly give me some advice on how to do this! 
>
>TIA,
>
>Rick
>
>
>Do you Yahoo!?
>Yahoo! Mail - More reliable, more storage, less spam
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list