Emailing a Report, need Help!!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I've searched the board and I can't find something similiar.

I'm trying to email a Report. I have built a button onto a form. I would
like users to open the report and view it. When the users close the report,
I have built a msgbox to display asking them if they want to email the
report. I have built this code in the Reports On Close.

My problem: The message box appears. I click Yes, I get an Action Failed
message. I click on Halt. It says "This action can not be carried out while
processing a form or report event.

How can I get this to go through so the document will be posted in my outlook?

Here is the code that I posted in.

Private Sub Report_Close()
Dim intResponse As Integer
Dim strPrompt As String


strPrompt = "Do you want to Email this Report?"

intResponse = MsgBox(strPrompt, vbYesNo, "Collections")

If intResponse = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunMacro "Send to Outlook"
End If
End Sub


Thanks
AccessFitz
 
DLG,

Thanks for your response. I've tried what you have recommended, and it
still hasn't worked. I'm getting the same message
 
not knowing what the Send to Outlook macro is actually doing makes it
unclear where the problem is. you may want to convert the macro to a vba
subroutine so that you can step through it in the debugger and get better
error messages and error trapping.
 

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

Back
Top