Email a report for a individual record

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

Guest

I am working on a database to handle incoming Leads for our company. I have
a report set up to for new leads which need to be sent to a salesmen. What I
need to do is have the report only send the report for the record which is
shown on the form at that time by primary key field name [process number].
(not all records) which is what it is currently doing.

Any help would be greatly appreciated.
 
I have also tried using the following statement in the "email button" code,
but am not having success. If anyone can point me in the right direction it
would be a great help.

![frm dealer lead process].[process number]

frm dealer lead process being the form name and process number being the
field I want to match for the report.
 
below is the code for what i have done, similar scenario but without having
to make a report.


Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click

Dim stDocName As String

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

DoCmd.SendObject , stDocName, To:="(e-mail address removed)", _
Subject:="HelpDesk Report ID # " & Forms!frmAdminReviewProblem!txtID & _
" is currently being looked into.", _
MessageText:="The information that you sent:" & Chr$(10) & Chr$(10) & _
"HelpDesk Report ID: " & Forms!frmAdminReviewProblem!txtID & Chr$(10) _
& "User ID: " & Forms!frmAdminReviewProblem!txtuid & Chr$(10) _
& "Status: " & Forms!frmAdminReviewProblem!txtstatus &
Chr$(10) _
& "Priority: " & Forms!frmAdminReviewProblem!txtPriority &
Chr$(10) _
& "Department: " & Forms!frmAdminReviewProblem!txtDepartment &
Chr$(10) _
& "Title: " & Forms!frmAdminReviewProblem!txtTitle &
Chr$(10) _
& "Description: " & Chr$(10) & _
" " & Forms!frmAdminReviewProblem!txtDescription, _
EditMessage:=True

DoCmd.Close

this will send an email that has a subject line of:
"HelpDesk Report ID # ## is currently being looked into."
and a body of:
The information that you sent:

HelpDesk Report ID: ##
User ID: #######
Status: #######
Priority: #######
Department: ########
Title: ####################
Description:
########################################
########################################
########################################
####################################etc.

basically the save button saves the record, then opens an email with the
data from the text and combo boxes on the form. currently this does not send
the email automatically, you still need to hit the send button on the email
window. changing the "editmessage:=true" to false will keep the email window
from popping up, but currently i still need to hit the send/receive button in
outlook to send the email or wait until outlook tries to receive emails at
its regular interval. (30 min as default)
also it currently only sends to whatever email address is in the line
'To:="(e-mail address removed)" '

currently trying to get the 'To:=' line to be able to be changed according
to user id, and to clean up all of the 'Forms!frmAdminReviewProblem' lines.
if you have anyideas on this, would love to hear them...

hope this helps



Barry Phillips said:
I have also tried using the following statement in the "email button" code,
but am not having success. If anyone can point me in the right direction it
would be a great help.

![frm dealer lead process].[process number]

frm dealer lead process being the form name and process number being the
field I want to match for the report.


Barry Phillips said:
I am working on a database to handle incoming Leads for our company. I have
a report set up to for new leads which need to be sent to a salesmen. What I
need to do is have the report only send the report for the record which is
shown on the form at that time by primary key field name [process number].
(not all records) which is what it is currently doing.

Any help would be greatly appreciated.
 
Back
Top