Combobox to show only empty field (1 Viewer)

Danick

Registered User.
Local time
Today, 09:44
Joined
Sep 23, 2008
Messages
351
I'm using a text field in a continuous form to show Y or N or just leave blank if nothing is filed in yet.

To filter out the records, I'm using a combobox with a filter like this

Code:
If Not IsNull(Me.cboYN) Then
    strWhere = strWhere & "([Tested] = """ & Me.cboYN & """) AND "
     End If

This works fine if the field was filed in. But I can't find a way to use this combobox to show only empty fields.
Any way I can show empty records that have an empty [tested] field?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:44
Joined
Oct 29, 2018
Messages
21,474
Have you tried adding an Else branch to do the opposite?
 

Danick

Registered User.
Local time
Today, 09:44
Joined
Sep 23, 2008
Messages
351
Have you tried adding an Else branch to do the opposite?
No sure how to do that. Besides, that would filter out only the "N". So I'd still see the "Y" and anything else someone may have put there. Like N/A...

I'm trying to see what else hasn't been tested yet. So basically, just blank records...
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:44
Joined
Oct 29, 2018
Messages
21,474
No sure how to do that. Besides, that would filter out only the "N". So I'd still see the "Y" and anything else someone may have put there. Like N/A...

I'm trying to see what else hasn't been tested yet. So basically, just blank records...
Just blank records would use a criteria similar to

WHERE FieldName Is Null

Can you try to adapt that to your code? I can't tell you how without seeing your setup.
 

Danick

Registered User.
Local time
Today, 09:44
Joined
Sep 23, 2008
Messages
351
That's not working. Access run-time error 2465. Can't find the field referred to in expression.
Seems like a combobox can't be used to filter blank records. Will need to find another way to do that...
 

Danick

Registered User.
Local time
Today, 09:44
Joined
Sep 23, 2008
Messages
351
Found a workaround. Had to add another button just for null values. So now I've got the combo for the Ys and Ns and using another button for the nulls.

Code:
Me.Filter = "IsNull([Tested])"
Me.FilterOn = True

It's not pretty, but it works...
 

Users who are viewing this thread

Top Bottom