Fix Crash when setting a filter in a Report in a Navigation Control (Access 2013/2016)
I have a form with a navigation control. In a navigation button, I set the Navigation Target to the Report "rptTest". In the Open event of rptTest, I set a filter:
Private Sub Report_Open(Cancel As Integer)
Me.Filter = "TestID > 5"
Me.FilterOn = True
' Access crashes on the End Sub Statement in the second execution
When I navigate to this button, the Report_Open event is fired twice, and the crash occurs on the Exit Sub the second time around. It is a hard crash with the message "Access has stopped working".
I can produce the crash as many times as I want, on different machines and on Access Versions 2013 and 2016. My Access 2016 version is 1710 (Build 8625.2132 Click-To-Run), i.e., the most recent version.
Known workaround: Instead of setting then Filter property, set the recordsource of the report:
Me.Recordsource = "Select * From & " Me!Recordsource & " Where TestID > 5"
This requires that the record source is a table or a stored query.
Kläy Computing AG
Thanks for reporting this bug.
We will investigate and will update the status accordingly.