filter a recordset

spinkung

Registered User.
Local time
Today, 14:53
Joined
Dec 4, 2006
Messages
267
Hi

i am trying to filter a recordset but it doesn't seem to be working.

The forms recordset has 3 rows. One of the fields is a status flag. I want to only show the rows in my recordset where the StatusFlag is empty ("").

I use the filter but when i do a row count i still get 3 rows

Code:
        Set rs = srcForm.Recordset
        rs.Filter = "StatusFlag = """""
        MsgBox rs.RecordCount

can anone tell me what im doing wrong

thanks
 
Is it empty, as in nothing was entered, or was a 0-length string "" inserted by user or by default?
 
Hi

the field is typed by the user from 'H' to ''. so 0 length string??

Thanks
 
rs.Filter = "StatusFlag = ''"

or

rs.Filter="StatusFlag Is Null" , since I am still not sure where the value comes from
 
How about:
rs.Filter= "Len(StatusFlag & vbNullString)=0"

Though if it is a flag why not use a Boolean field?
 
#5 Of course *beating head against screen* :D
 

Users who are viewing this thread

Back
Top Bottom