i'm looking for a clean way to detect that no records match the entered criteria after a user applies a filter. i tried to put in some code in the on apply filter event like this:
If IsNull(DLookup(1, Me.RecordSource, Me.Filter)) Then
Cancel = True
MsgBox "No records match the entered criteria."
but an automation error occurs if the user selected something from a combo box to filter on.
i also tried to detect if the form jumps to a new record in the on apply filter event but that doesnt work because the actions in event procedure occur before the filter is applied or removed. also, that wouldnt work for users that don't have permissions to add new records.
i know about creating a seperate filter form but this would create way too much maintenance every time a new field is added to the form.