Single record report sending

wizz_darlo

Registered User.
Local time
Today, 03:28
Joined
Aug 1, 2005
Messages
16
Hi, I've seen bits and pieces of the answer to this in other threads but because i'm a total newb to Vb I'm not able to piece it all together to get what I want.

Basically so far I have two buttons on my form which allow me to preview the current record in a report I made in design view, and also to print the current record in the form on a report.
However I don't seem able to figure out how to make a button send the current record in the form to an email address in .rtf or html format in the report.

Currently my button for previewing looks like this and I've had a slight go at adapting it but I always get error messages.

Private Sub Command63_Click()

Dim strReportName As String
Dim strCriteria As String

If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "comreport1"
strCriteria = "[System Number]='" & Me![System Number] & "'"


DoCmd.OpenReport strReportName, acViewPreview, , strCriteria

End If
End Sub

Anyone who could lend a hand would be straight in to my good book!! :D
 
There are two sample Databases in the following thread that you can download.

The first example will show you how to email the current record.

Link

Hay
 
Dummy report

Hi
I just implemented something really simple.
See if it works for you.
Add a field Dummy which is a Yes/No field in the underlying table.
You know the underlying query of the report. Save it as a new query called qryDumyReport.
In the old as well as new query add the new Dummy field.
Now base the report on the new qryDummyReport which has a true condition for the Dummy check mark.
Open the form in design view. On the OnCurrent event type
Me.Dummy=True
On the OnClose as well as AfterUpdate events type
Me.Dummy=False
Then add a new button on the form. The command button wizard will provide you with report operations. Choose mail report from in there.
Boom.
Next you know it - with the current form open on screen you can email the current record.
I also struggled a lot with it
HTH.
Suds.
 

Users who are viewing this thread

Back
Top Bottom