SyBeerianTyGRRRR
Technical User
Hi folks,
Can anyone tell me how to create a cmd button on a Form that when clicked will send the the report pages of the currently selected record to an e-mail recipient that is selected in a drop down combo box on the same form??
I am trying to use a variation of some code i use to print selected pages of a report. This code is as follws:
Private Sub Command98_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptPlmkrsInfSheet"
stLinkCriteria = "[AddressID] = " & Me.AddressID
DoCmd.SendObject stDocName, acNormal, , stLinkCriteria
End Sub
Basically i replaced OpenReport with SendObject but i appear to be missing something somewhere as this returns the following message:
"The format inwhich you are attempting to output the current object is not available"
Report Snapshot format is what i want but i don't know how to invoke this format in VBA??
The names of the relevant components are as follows:
Form from which record is selected = frmPlmkrsDbse
Primary Key of form = AddressID
Underlying Table that contains records = tblPlmkrsDbse
Report name = rptPlmkrsInfSheet (each record produces a 2 page report.)
Combo Box that contains e-mail addresses = cboMailCoach
Any assistance would be much appreciated.
Thanks
Can anyone tell me how to create a cmd button on a Form that when clicked will send the the report pages of the currently selected record to an e-mail recipient that is selected in a drop down combo box on the same form??
I am trying to use a variation of some code i use to print selected pages of a report. This code is as follws:
Private Sub Command98_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptPlmkrsInfSheet"
stLinkCriteria = "[AddressID] = " & Me.AddressID
DoCmd.SendObject stDocName, acNormal, , stLinkCriteria
End Sub
Basically i replaced OpenReport with SendObject but i appear to be missing something somewhere as this returns the following message:
"The format inwhich you are attempting to output the current object is not available"
Report Snapshot format is what i want but i don't know how to invoke this format in VBA??
The names of the relevant components are as follows:
Form from which record is selected = frmPlmkrsDbse
Primary Key of form = AddressID
Underlying Table that contains records = tblPlmkrsDbse
Report name = rptPlmkrsInfSheet (each record produces a 2 page report.)
Combo Box that contains e-mail addresses = cboMailCoach
Any assistance would be much appreciated.
Thanks