hi there,
i have a report that i want to open, but using the DoCmd method sends it to print. On the form is a combo box which has a list of mandates to choose from. When a mandate is chosen, the rest of the information is displayed in the tab display beneath the combo box. I want to open a report but then only print the current record displayed. But first, i think that I need to open the report without printing so that i can tell the report which record to print. Is this right? s-)
This is the code that i've started to use. I'm not even sure if it will do what i need it to.
Private Sub cmdPrintStatement_Click()
' Want to only print the statement for the Investment Mandate currently displayed.
'DoCmd.OpenReport "Policy Statement"
Dim stDocName As String
stDocName = "Policy Statement"
Dim stLinkCriteria As String
stLinkCriteria = "[Mandate Name] = " & Me![txtTabInvestMandate] '.Column(0)
DoCmd.OpenReport stDocName
Reports.Item("Policy Statement"
.RecordsetClone.FindFirst stLinkCriteria
Reports.Item("Policy Statement"
.Bookmark = Reports.Item("Policy Statement"
.RecordsetClone.Bookmark
End Sub
Can you help me with this?
thankyou very much
i have a report that i want to open, but using the DoCmd method sends it to print. On the form is a combo box which has a list of mandates to choose from. When a mandate is chosen, the rest of the information is displayed in the tab display beneath the combo box. I want to open a report but then only print the current record displayed. But first, i think that I need to open the report without printing so that i can tell the report which record to print. Is this right? s-)
This is the code that i've started to use. I'm not even sure if it will do what i need it to.
Private Sub cmdPrintStatement_Click()
' Want to only print the statement for the Investment Mandate currently displayed.
'DoCmd.OpenReport "Policy Statement"
Dim stDocName As String
stDocName = "Policy Statement"
Dim stLinkCriteria As String
stLinkCriteria = "[Mandate Name] = " & Me![txtTabInvestMandate] '.Column(0)
DoCmd.OpenReport stDocName
Reports.Item("Policy Statement"
Reports.Item("Policy Statement"
End Sub
Can you help me with this?
thankyou very much