Hi Folks
Im trying to create a report based on the current form and the subform contained within the main form.
Currently I have a print report button on my main form.The report is based on a parameter query which prompts for a OrderID and then displays the report. Now rather than having to prompt the user for the OrderID (which by the way is on the subform currently displayed). I want it to reference this ID field so that the user doesnt have to be prompted.
Here is how I thought I could do it:
Private Sub btnPrintRec_Click()
On Error GoTo Err_btnPrintRec_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PrintOff"
srLinkCriteria = "[PrintOrderDetails].[OrderID]=" & Me.[frmOrders].[OrderID]
DoCmd.OpenReport stDocName, acPreview
Clearly Im way off the mark, so any pointers would be greatly appreciated
Thanks
Rodmc
Im trying to create a report based on the current form and the subform contained within the main form.
Currently I have a print report button on my main form.The report is based on a parameter query which prompts for a OrderID and then displays the report. Now rather than having to prompt the user for the OrderID (which by the way is on the subform currently displayed). I want it to reference this ID field so that the user doesnt have to be prompted.
Here is how I thought I could do it:
Private Sub btnPrintRec_Click()
On Error GoTo Err_btnPrintRec_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PrintOff"
srLinkCriteria = "[PrintOrderDetails].[OrderID]=" & Me.[frmOrders].[OrderID]
DoCmd.OpenReport stDocName, acPreview
Clearly Im way off the mark, so any pointers would be greatly appreciated
Thanks
Rodmc