I have a report where I want to give preference to a recordsource where certain records have been "Selected". I.e., I toggle the RecordSource with a simple filter. The code below works fine in a form, but for some reason not in a report. I tried the code in both the OnLoad and OnCurrent events but it made no difference. I can solve the problem with two different RecordSource queries, but I thought there was a simpler way?
Code:Private Sub Report_Open(Cancel As Integer) Me.Filter = "[Selected] <> ''" Me.FilterOn = True If Me.RecordsetClone.RecordCount = 0 Then Me.FilterOn = False End Sub