Combobox to show only empty field

Danick

Registered User.
Local time
, 20:17
Joined
Sep 23, 2008
Messages
371
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?
 
Have you tried adding an Else branch to do the opposite?
 
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...
 
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.
 
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...
 
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

Back
Top Bottom