OutputTo command

D

DavidG

I'm using the OutputTo command to save reports to snapshot files
leaving the new filename blank so the user gets a windows dialog box to
name the file and choose the subdirectory location. Everything works
great but the user wants to be able to click the cancel button in the
windows dialog box to cancel the process. (Clicking the cancel button
only causes the dialog box to reappear making cancel impossible. You
have to complete the output process by naming and saving a file.)

Here is the function I call from a form that loads with each report:

Function fCreateEmailSnapShot(strReport As String) As Boolean
On Error GoTo fCreateEmailSnapShotErr
DoCmd.SelectObject acReport, strReport, True
DoCmd.OutputTo acOutputReport, strReport, acFormatSNP

'hide the database window. Itis unhidden by one of the above
commands.
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

'indicate successful process
fCreateEmailSnapShot = True
Exit Function

fCreateEmailSnapShotErr:
fCreateEmailSnapShot = False
Resume
End Function
 

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