Emailing a selected record from a form

M

MAG

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.
 
V

Van T. Dinh

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.
 
M

MAG

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
 
V

Van T. Dinh

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.
 
M

MAG

Thank you so much, I will try that.

Van T. Dinh said:
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.
 
Top