Hello
I'm trying to create a button on a form that when clicked automatically
mails a re****t. However, the tricky part is that I want that re****t to
only
contain the data from the current record.
I am an Access amateur but have fudged together the following code where
"Bookingref" is the field that identifies the current and "Invoice
Instruction" is the re****t I want to mail.
Something's not quite working and I'm too much of an idiot to know what it
is.
Private Sub Mail_Re****t_Click()
On Error GoTo Err_Mail_Re****t_Click
Dim stDocName As String
Dim MyWhereCondition As String
MyWhereCondition = "Bookingref= " & Me.Bookingref
stDocName = "Invoice Instruction"
DoCmd.SendObject acRe****t, stDocName, , MyWhereCondition
Exit_Mail_Re****t_Click:
Exit Sub
Err_Mail_Re****t_Click:
MsgBox Err.Description
Resume Exit_Mail_Re****t_Click
End Sub