I have a form based on a read-only query. It is a split form, so people can filter it. If a filter is applied that shows no records, the form disappears.
Well, the header doesn't disappear. I intend to have a message in the header show up when there are no records showing how to click 'Toggle Filter' so they can see the form again. My problem is that I can't find a good event to run this with.
So far, I've tried Form_Current, Form_ApplyFilter, and Form_AfterFinalRender. Finalrender never fired, applyfilter occurs before the filter is applied, and current doesn't fire when there are no records.
The code I am using to do this works if it can just happen when the form is blank:
Dim RS As Recordset
Set RS = Me.RecordsetClone
If RS.RecordCount = 0 Then
Me.lblNotice.Visible = True
Else
Me.lblNotice.Visible = False
End If
RS.Close
Set RS = Nothing
Well, the header doesn't disappear. I intend to have a message in the header show up when there are no records showing how to click 'Toggle Filter' so they can see the form again. My problem is that I can't find a good event to run this with.
So far, I've tried Form_Current, Form_ApplyFilter, and Form_AfterFinalRender. Finalrender never fired, applyfilter occurs before the filter is applied, and current doesn't fire when there are no records.
The code I am using to do this works if it can just happen when the form is blank:
Dim RS As Recordset
Set RS = Me.RecordsetClone
If RS.RecordCount = 0 Then
Me.lblNotice.Visible = True
Else
Me.lblNotice.Visible = False
End If
RS.Close
Set RS = Nothing
Last edited: