>Does anybody in here has a class or code that let me search just like the FIND DIALOG CLASS that comes with VFP 6.0 but in more than one table?
>
>The Find Dialog Class searches in the parent table only, not in the child table (my case).
>
>Thank you in advance, any comments will be welcome.
Morys,
I had a never finished thus found its way to trash code :) Outline is as follows (considering ppl would want to search for what they could see on a form - IOW QBE) :
-Begin a transaction
-Add new record to parent and all childs
-Let the user fill in (in an enhanced version with wildcards and identifiers such as !, except). Also fields with controlsources of type numeric, date* etc should be more flexible to accept a range (at least I had done this part with a class that invokes a "range" container and returns a string like "between ...":)
-Using relations in DE and/or grid properties start to create SQL body
-Traverse all controls on form (including grids) to collect non-empty ones (or let control classes do it as their value changed when lsearchmode = .t.)
-Build where part using collected data (where -controlsource- -operator- -value- ...)
-Rollback
-Run SQL and get just parent PK list
Complexity and time to code was my main reasons to quit doing it (or postpone). Hope there is a ready one.
BTW: If you also keep a view (whether you don't use it directly) with necessary connections to childs and it's "initial selected alias" find dialog might utilize it. But I don't use "find dialog class" and don't know if that's the case or not.
Good luck
Cetin