Filter Records from a button (1 Viewer)

Allan

Registered User
Local time
Today, 00:46
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:

grnzbra

Registered User.
Local time
Today, 00:46
Joined
Dec 5, 2001
Messages
376
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?
 

Allan

Registered User
Local time
Today, 00:46
Joined
Apr 28, 2001
Messages
42
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
 

boblarson

Smeghead
Local time
Yesterday, 16:46
Joined
Jan 12, 2001
Messages
32,059
Allan:

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

Allan

Registered User
Local time
Today, 00:46
Joined
Apr 28, 2001
Messages
42
Tks Bob,

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

Allan
 

Users who are viewing this thread

Top Bottom