Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a form be sent from Access 2000 via Outlook as eMail? 4

Status
Not open for further replies.

Phideaux

Technical User
May 1, 2003
51
0
0
US
I need to send forms from Access 2000 via Outlook. It is a Work Order reciept and I've tried to find a way with no real success. The W/Os have a Outlook user name as one of the fields. An eMail address field is also available. There are 10 fields in all. I also want to automatically check a yes/no block when the forms are sent out. The forms are sorted and populated from a query. I'm planning to use a macro or button click to transmit the eMailed forms.

I'm having no success locating anything about sending an entire form during my searching on the site.

Any help will be MUCH needed and Welcomed.

Thanks for considering my delemma.
This is WAY outside of my league.

Phideaux

The mind is the best toy.
Play with someone else's often
 
Phideaux
Have you tried sending the report as a Snapshot?

One method involves exporting the report as a snapshot and then e-mailing it.

The Help also indicates there is a way to do it through VBA.


Tom
 
I am going to ask the same question as THWatson.

Have you tried to use a snapshot via a report?

I have code for sending the snapshot.

You have to build a report for this.

Let me know if I can assist you more.



Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Jbento, I'd be interested in seeing your code that would allow me to send a snapshop with the push of a button.

Currently I've got a list of e-mail addresses and user names in one table, and a list of daily stats and user names in another.

I'd like to be able to send out each individual user's stats to them by mail after selecting their name from a drop down.
 
Tom & Jerome,
thanks for looking at my post and responding

I've made the report and followed up to send it to Outlook. I'm still working on the way to automatically pickup the user name from the proper field and automatically enter it in the "TO" portion of the Outlook eMail form.

Jerome,
That code you mentioned would be Great!

One other item I'm working on, making the report only pick up one Work Order at a time so that the reciept goes to the person who generated the request and not a report covering multiple Work Orders from several users.

Phideaux



The mind is the best toy.
Play with someone else's often
 
This is what I use:

Private Sub Form_Unload(Cancel As Integer)
Dim strSubject As String

strSubject = Me.title
If radio1.Value = True Then
DoCmd.SendObject acSendReport, "rpt_test", acFormatSNP, "", "emailtest@somewhere.com", , strSubject, "Body Text Here", False

End If

End Sub

Hope that helps,

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
I've ended up using this code to send my eMails so far everything works well. I have one final item to figure out. In order to make the operation complete. I need to iniclude a line of code that will change a check box named "eMailSent" from the unchcked condition to the checked condition so that my query will not pick this particular item the next time I review eMails to send.

I found this in a Faq and after a little working on it it does the job nicely.

ANy help will be sooooo needed. thanks in advance




Private Sub SendeMail_Click()
'******begin code******
Dim ReqSubBy As String
Dim DateOpnd As String
Dim notes As String
Dim WorkOrder As String
Dim WorkDesc As String

'**create variables for Outlook
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

'**gathers information from your form. this sets the string variable to your fields
ReqSubBy = Me!ReqSubBy
DateOpnd = Me!DateOpnd
notes = Me!notes
WorkOrder = Me!WorkOrder
WorkDesc = Me!WorkDesc

'***creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

'***creates and sends email " Date Targeted for Completion ---& " DatTarget & "

With objEmail
.To = ReqSubBy
.Subject = " Your Request has been Assigned " & notes & " " & WorkOrder
.Body = " Date Opened --- " & DateOpnd & " " & "---- Work Description --->>> " & WorkDesc & " ----------->>>>>>>>>>>>>>> When you request Follow up information, Please refer to the W/O Number"
.Send
'*** "SEND"- sends the email in Outlook. Change to DISPLAY if you want to be able to
'modify or see what you have created before sending the email
End With

'**closes outlook
objOutlook.Quit
Set objEmail = Nothing

Exit Sub
'****end code****

End Sub


The mind is the best toy.
Play with someone else's often
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top