From a form I am allowing a user to choose a customer in a combo box. Users press button Make Report and it should open the report with correct customer. However when you press the button it asks for CustChoice parameter value (even though when code is stopped and you hover over CustChoice it's value is correct). Can someone please help me?
Here is my code:
Private Sub Make_Report_Click()
On Error GoTo Make_Report_Click_Err
Dim CustChoice
If Me.Customer.Value = Null Then
CustChoice = 1
Else
CustChoice = Me.Customer.Value
DoCmd.OpenReport "rpt_Customer", acViewReport, "Customer", "Customer = CustChoice", acNormal
End If
Here is my code:
Private Sub Make_Report_Click()
On Error GoTo Make_Report_Click_Err
Dim CustChoice
If Me.Customer.Value = Null Then
CustChoice = 1
Else
CustChoice = Me.Customer.Value
DoCmd.OpenReport "rpt_Customer", acViewReport, "Customer", "Customer = CustChoice", acNormal
End If