I have a Navigation Form with multiple tabs. Each tab contains a subform with a different report, as well as buttons. In one of my tabs, I have a report that I want to filter based on a certain criteria. I created a combo box on top of the report, which filters all items in the report based on a criteria.
Assume we're on the specific tab mentioned, the diagram looks something like this:
I have the following code in the Subform containing the combo box filter and report, with let's say the values in the combo box are 1-5. :
I encounter the following issue with the above code as soon as I select a value in the combo box filter:
I updated the code:
Now, the report filters based on whatever value I select from the combo box, but I encounter the following issues where the value I select does not populate in the combo box, but instead, the value is populated with the "last" value I selected, not the current one. Secondly, every other value I select to filter, I receive this error:
The above error points me to the following code:
I don't know what's causing this issue and I posted the same issue on StackOverflow, but all I was told was to avoid using a Navigation Form. Unfortunately I cannot re-factor the code.
Anyone know what is causing this issue?
Assume we're on the specific tab mentioned, the diagram looks something like this:
I have the following code in the Subform containing the combo box filter and report, with let's say the values in the combo box are 1-5. :
Code:
Private rpt As Report
Private Sub Form_Load()
Set rpt = Me.subreport_TestReport.Report
End Sub
Private Sub comboBox_FilterByID_AfterUpdate()
rpt .Filter = "ID = " & Me.comboBox_FilterByID
rpt .FilterOn = True
End Sub
I encounter the following issue with the above code as soon as I select a value in the combo box filter:
I updated the code:
Code:
Private Sub comboBox_FilterByID_AfterUpdate()
Me.subreport_TestReport.Report.Filter = "ID = " & Me.comboBox_FilterByID
Me.subreport_TestReport.Report.FilterOn = True
End Sub
Now, the report filters based on whatever value I select from the combo box, but I encounter the following issues where the value I select does not populate in the combo box, but instead, the value is populated with the "last" value I selected, not the current one. Secondly, every other value I select to filter, I receive this error:
The above error points me to the following code:
Code:
Me.subreport_TestCasesBCR.Report.FilterOn = True
I don't know what's causing this issue and I posted the same issue on StackOverflow, but all I was told was to avoid using a Navigation Form. Unfortunately I cannot re-factor the code.
Anyone know what is causing this issue?