hi,
I have created a form that loads as add new record.
I also have a command button on my form that on click prints the current record entered as a report.
I would like the printed report to be sent in an email on the same command.
can anyone help with the code for this?
This is what I have so far on the command button
Private Sub cmdPrint_Click()
If Me.Dirty Then
Me.Dirty = False
End If
'Print current record
'using rptQuery.
If IsNull(Me!ID) Then
MsgBox "Please select a valid record", _
vbOKOnly, "Error"
Exit Sub
End If
DoCmd.OpenReport "rptQuery", , , _
"ID = " & Me!ID
DoCmd.Close acForm, "Goods In Delivery Query Form"
End Sub
TIA
I have created a form that loads as add new record.
I also have a command button on my form that on click prints the current record entered as a report.
I would like the printed report to be sent in an email on the same command.
can anyone help with the code for this?
This is what I have so far on the command button
Private Sub cmdPrint_Click()
If Me.Dirty Then
Me.Dirty = False
End If
'Print current record
'using rptQuery.
If IsNull(Me!ID) Then
MsgBox "Please select a valid record", _
vbOKOnly, "Error"
Exit Sub
End If
DoCmd.OpenReport "rptQuery", , , _
"ID = " & Me!ID
DoCmd.Close acForm, "Goods In Delivery Query Form"
End Sub
TIA