Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering Tables

Status
Not open for further replies.

gareth001

Technical User
Feb 4, 2003
43
GB
Hi,
I have a working filter which uses the required field [defined as Field] and record(s) [Defined as Node] within which are needed. with the below code:

Code:
    Set tbl = Screen.ActiveDatasheet
        tbl.Filter [b]=[/b] Field & _
             "=" & _
             Node
        tbl.FilterOn = True

However I'm now wanting to do the reverse and select what does not equal the field and record(s) I've defined. I was thinking this would be a simple case of changing the = to Not as below:

Code:
    Set tbl = Screen.ActiveDatasheet
        tbl.Filter [b]Not[/b] Field & _
             "=" & _
             Node
        tbl.FilterOn = True

But unfortunatly it comes up with a debug error. Can this be done? Or is there some other means than above?

Thanks
 
Simply replace "=" with "<>" in your first code snippet.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top