Send email from a form with data from the form?

  • Thread starter Thread starter Brook
  • Start date Start date
B

Brook

Does anyone know of any way that I could have an option to
send an email from a form that contains the forms data?



Thanks,

Brook
 
Yes. Pull that data to a report and send the report in an email if you need
to send a lot.

If you only want a few items, (say the email address, the persons name, a
reference number, etc.) then just refer to them in your sendobject
statement. You can refer to fields when building your email title, to/cc,
text, etc.

Give us more details if you need a more detailed response.

Rick B

Does anyone know of any way that I could have an option to
send an email from a form that contains the forms data?



Thanks,

Brook
 
Here is an example from my database that pulls a report with some data and
sends an email with some of the more important fields in the email...


Private Sub Send_Email_Click()
Dim msg

If (IsNull([Reference])) Then
msg = "Please select a record before creating the email."
MsgBox (msg)
'If no record selected, stop procedure
Exit Sub
End If

Dim varSubject As String
Dim varText As String
Dim varDocName As String
Dim varRep As String

varRep = [UserID]
varSubject = "Client: " & [Client_] & " - " & Left([ClientName], 15) & "
Ref: " & [Reference] & " Assignment: " & [Assignment] & " - " & [Type] & "
Rep: " & varRep
varText = "The following Assignment has been made:" & Chr(10) &
"Assigned Rep: " & varRep & Chr(10) & "Ref: " & [Reference] & Chr(10) &
[Client_] & " - " & [ClientName] & Chr(10) & [Assignment] & " " & [Type]
If [Assignment] Like "CONS*" Then
varDocName = "Misc - Consulting Schedule Notification"
Else: varDocName = "Misc - Install Schedule Notification"
End If

DoCmd.OpenReport varDocName, acViewPreview, "", "" ' Open the Report
DoCmd.SendObject acSendReport, , "Snapshot Format", , , , varSubject,
varText, True
DoCmd.Close

Exit_Send_Email_Click:
Exit Sub

End Sub




Does anyone know of any way that I could have an option to
send an email from a form that contains the forms data?



Thanks,

Brook
 
Ok,

Here is exactly what I am trying to accomplish:

I have a two tables: tblEmailAddress & tblCallData

I also have two forms: frmCallCenter & frmCallDetails

Both of these forms use the same tblCallData


the frmCallCenter has a small amount of information,
Company Name, Company ID, Participant Name. When the user
clicks a button "CallDetails" the frmCallDetails comes up
based on the primary key CallID.

On the frmCallDetails, I would like to have a button:
"Send Email to Administrator" -- which will be based on
the tblEmail.

I would like to have it pre-established on what fields
from the form will be emailed.

When the user clicks the Send Email button, they are
prompted to choose the email address.

Once the email address is chosen the email is sent with
the pre-determined fields based on that particular
record/form data.

Hope this is clear.

Brook
 
Back
Top