Hi Everyone,
I've created a report that currently is listing sales information, all orders and total sales for all customers. I have created a seperate form with a combo box that allows the user to select a company name from the list. Once a name is selected, I would like the report to only display the information for that one customer.
I have made the following decleration:
Public pubID as Integer
The following event is in the after update event of the form with the combo box.
Private Sub companyName_AfterUpdate()
On Error GoTo Err_openReport_Click
pubID = Me.CompanyName.Column(0)
Dim stDocName As String
stDocName = "Customer Report"
DoCmd.openReport stDocName, acPreview
Exit_openReport_Click:
Exit Sub
Err_openReport_Click:
MsgBox Err.Description
Resume Exit_openReport_Click
End Sub
I would appreciate some help with the code that needs to go into the Report so that it displays only the company that the user selected.
Thank you in advance for your help.
Regards,
Tess
I've created a report that currently is listing sales information, all orders and total sales for all customers. I have created a seperate form with a combo box that allows the user to select a company name from the list. Once a name is selected, I would like the report to only display the information for that one customer.
I have made the following decleration:
Public pubID as Integer
The following event is in the after update event of the form with the combo box.
Private Sub companyName_AfterUpdate()
On Error GoTo Err_openReport_Click
pubID = Me.CompanyName.Column(0)
Dim stDocName As String
stDocName = "Customer Report"
DoCmd.openReport stDocName, acPreview
Exit_openReport_Click:
Exit Sub
Err_openReport_Click:
MsgBox Err.Description
Resume Exit_openReport_Click
End Sub
I would appreciate some help with the code that needs to go into the Report so that it displays only the company that the user selected.
Thank you in advance for your help.
Regards,
Tess