Filter a ParentTable

Hallo2oo5

New member
Joined
Apr 19, 2007
Messages
3
Location
Dublin, Ireland
Programming Experience
5-10
Hi there,

I have a tough question here that I hope someone can answer.

Is there any way to filter a parent table based on a search done on its childtable.

I'd like to be able to return all parentrows whose childrows matched the search criteria

I tried to do this by searching the childtable and returning it's parentRow through its relation. I then saved the parentRow Primarykey in a string.(eg: "ClientCode = 'HALG01' OR ClientCode = 'MALH02'") I then set the parentTable’s bindingsource filter to equal the saved string.

The problem with this is if the search results go over a certain number, say 1000, the program throws up an error ('System.StackOverflowException' occurred in System.Data.dll) because of the lenght of the filter string

(example of filter string)
bs.Filter = "ClientCode = 'HALG01' OR ClientCode = 'MALH02' OR ClientCode = 'HALG01' OR ClientCode = 'GERH02' OR ClientCode = 'BOPD01' OR ClientCode = 'RORJ02' etc..."

So does anybody know how to do this
Thanks Ger
 
Back
Top