Emailing a selected record from a form

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

Guest

I have created a form and set up a command button to send_object (a report)
but I still can't get the form set up to send only one record. It sends all
of the records. I have tried using a filter, but I have had no success.
 
Describe the relevant Table Structure, your Form and post the code for the
CommandButton_Click Event as well as the SQL String of the Query being used
as the RecordSource for the Report.
 
I hope this is what you need.
Command Button

Private Sub Send_Object_Click()
On Error GoTo Err_Send_Objectform_Click

Dim DocName As String
Dim MyForm As Form

DocName = "New Service Calls"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject A_FORM, DocName, True
DoCmd.Send_Object
DoCmd.SelectObject A_FORM, MyForm.Name, False

Exit_Send_Objectform_Click:
Exit Sub

Err_Send_Objectform_Click:
MsgBox Error$
Resume Exit_Send_Objectform_Click

End Sub

Report

Private Sub Report_Open(Cancel As Integer)

End Sub
 
I don't recommend sending a Form which sends unnecessasy graphics &
background.

It is much better to send a Report instead and for Report, you can use a
Parametrised Query to filter the Records so that the Report's Recordsource
only has the Form's CurrentRecord.
 

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