FilterByForm Problem

Abbos

Registered User.
Local time
Today, 09:44
Joined
May 11, 2005
Messages
64
Hi,

On a form I have a button that allows me to FilterByForm. Although it works fine I don't have any checking in place, so when a field is filtered and a certain value is selected where there are no records in the table that match it currently just shows the same form but with all fields and names removed.

Can anyone help with a bit of code thay would say throw up a msgbox box if the result of the filter is 0 results?

Many Thanks,
 
Thanks but I can't seem to get this to work.

Here is my code:

Code:
Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
If Me.Recordset.RecordCount = 0 Then
MsgBox "no results"
End If
End Sub

It runs when a filter is applied or removed.

Everytime I apply a filter and this code runs I get the error saying Object Variable Not Set.

I have just noticed that in the status bar it shows "This recordset is not updateable". Just searching now to see what else I can find.

Can anyone help?

Would the Count() feature be of any use to also achieve what I need?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom