Okay, I am building a form in Access for running reports based on their selections...
I have it so the user can select various options and then the report is created using a dynamic query (based on their selection). I am running into a problem when I select a value from a combo box and click the command button to view the report.
The combo box on the report form is called poSelect. It lets them select a specific Purchase Order number. Each purchase order is assigned a autonumber ID which I am using as the PK.
In my report Load event, I have this:
' If they choose to select a purchase order, determine which PO was selected.
If rptOption = 2 Then
  Dim PO As Integer
    PO = [Forms]![frmReports].[poSelect]
End If
--------------------------
You'd think that this is a pretty straight forward command which places the value of the poSelect control into a varible named 'PO' so that I can use it in a query...however, every time I attempt to pull the report it asks me to input the value of the variable PO before the report will run.
How can I pass the value of poSelect on my form to the PO variable on my report?
Tags: