sending accesss form by e-mail

  • Thread starter Thread starter fahad
  • Start date Start date
F

fahad

Guest
Please

is there a way to send access form by e-mail using Microsoft Outlook.

Thanks. :confused:
 
I'm not sure about a form, but you can send a report saved as a snapshot format by outlook automatically.
 
fahad said:
Please

is there a way to send access form by e-mail using Microsoft Outlook.

Thanks. :confused:
I have the same question. How does one go about saving a report as a snapshot (Using a command button preferably), and then send it as an email (is it an attachment, does it fill in the main text area?) Thanks for any help.
Greg
 
There are a couple different methods.

This method requires setting up a table of email addresses. You can then add/edit/delete addresses easily through the table. The VBA module pulls the addresses from the table to execute the send email feature.

This code uses the Form_Open event to execute. You can set your own procedure to execute the code such as a button click.

The code is using [tblEmail] as the table with email addresses.

Also be sure your ADO libraries are set under Tools|References in VBA.

Hope this helps!

Private Sub Form_Open(Cancel As Integer)
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim stDocName As String
Dim strEmail As String

stDocName = "Report Name"

rs.Open "tblEmail", cn

With rs
Do While Not .EOF
strEmail = strEmail & .Fields("Email") & ";"
.MoveNext
Loop
.Close
End With

strEmail = Left(strEmail, Len(strEmail) - 1)

DoCmd.SendObject acReport, stDocName, acFormatSNP, strEmail, , , "Subject Line", , False

Exit Sub

End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom