RLTAYLOR
12-03-2002, 11:47 AM
I created a form with a subform. In form view, the form displays one record and the subform displays one record. The subform is set for "single form view". However, to view as a report, all the subform records are displaying. How can I correct this? The basic code to view a current record does not do the job. The goal is to requisition one item on a Purchase Order. Thanks in advance.
http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=38572
rainymac
12-06-2002, 03:03 PM
This is what worked for me in my report
Private Sub cmdPreviewReport_Click()
On Error GoTo Err_cmdPreviewReport_Click
Dim frmCurrentForm As Form
Set frmCurrentForm = Screen.ActiveForm
DoCmd.RunCommand acCmdRefresh
DoCmd.OpenReport "CEARequest_report", acViewPreview, , "[Request_Num]=" & Forms!CEARequest_form![Request_Num]
Exit_cmdPreviewReport_Click:
Exit Sub
Err_cmdPreviewReport_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewReport_Click
End Sub