email current record on a form

W

weircolin

Hi

I have set up on my database a means to print the current record on a
form using a report. Is there any way that this report could be
emailed to someone by clicking a button and the details being copied
into an email?

Cheers

Colin
 
W

weircolin

Hi

I have tried something myself with trying to do this. But when I try
to work it I get a error message saying "Type Mismatch".

This is my code

Private Sub cmdemail2_Click()
On Error GoTo Err_cmdemail2_Click

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Reference Number] = " & Me.[Reference Number]
DoCmd.SendObject "rptnewsletterdatabase", acReport, , strWhere
End If
Exit_cmdemail2_Click:
Exit Sub

Err_cmdemail2_Click:
MsgBox Err.Description
Resume Exit_cmdemail2_Click

End Sub

Any ideas?

Colin
 
Top