I'm trying to preview a report from an order form. Both the form and report are built upon the same query. I had hoped that the command button wizard would let me choose a relationship (ie, open report and find specific data to display), but it did not.
Do I need to add criteria in the query from the report design properties that link the report to the order ID# on the form? If so, how? Or do I need to add code to the onclick event to open the report. I've posted the vba that I have.
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click
DoCmd.PrintOut
Exit_Command93_Click:
Exit Sub
Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click
End Sub
Do I need to add criteria in the query from the report design properties that link the report to the order ID# on the form? If so, how? Or do I need to add code to the onclick event to open the report. I've posted the vba that I have.
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click
DoCmd.PrintOut
Exit_Command93_Click:
Exit Sub
Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click
End Sub