Filter Records from a button

Allan

Registered User
Local time
Today, 14:18
Joined
Apr 28, 2001
Messages
42
Delete Reference: Trying combinations I found one that works!!!

The second line should read: Me.Filter = "AdminDateCompleted Is Null"



Hi,
I want to filter records from a form with a button to isolate all incompleted tasks.

Incomplete tasks are identified with an empty field [AdminDateCompleted] which is formatted as a 'Medium Date'.

I am having trouble with the following code (created after several hours searching this forum and experimenting).

First click returns all the records allegedly filtered, 2nd click turns the filter off and the third click returns 1 (Filtered) blank form.

If Form.FilterOn = False Then
Me.Filter = IsNull(Me.AdminDateCompleted)
Me.FilterOn = True
cmdFilterActive.Caption = "Remove filter"
Else
Me.FilterOn = False
cmdFilterActive.Caption = "Filter"
End If

I would appreciate any advice please.

Allan
 
Last edited:
Allan said:
First click returns all the records allegedly filtered, 2nd click turns the filter off and the third click returns 1 (Filtered) blank form.
Allan

Is this what it's doing or what you want it to do?
 
Hi Grnzbra,

That was the original code result.

Thanks for the question however I found my error and included the correction as an edit at the start of my original post.

Apologies if this caused confusion and the edit was not the correct protocol.

Allan
 
Allan:

The better way would be to just include a separate post with the update.
 
Tks Bob,

Still on "L" plates for posting and building a db!

Allan
 

Users who are viewing this thread

Back
Top Bottom