I have a grandchild table (in a browse, on a layout/form.)
I've been able to accomplish what I need with the following line of code attached to button on a form, based on a parent/child/grandchild set:
(The problem is, it's slow as molasses even after setting the tables index. ~ Although maybe I need to set the index somehow differently as it's a child table of the set the form is based on?)
(vd_StartDate and vd_EndDate are values representing the beginning and end dates of the same year ie: 01/01/2010 and 12/31/2010)
By comparison, I can embed a calculated field on the form to show only the year. And "right clicking" on a field in the child browse and then selecting "QuickFilter" is "rocket-fast... (But it's a user based action that way.) ~ Isn't there any way to apply the "QuickFilter" on a browse column & assign the QuickFilter value via code? (This is just for display purposes, to limit the information presented to user.)
The only thing I haven't yet tried is to use topparent.QueryRun with an embedded browse calculated field that only shows the year. (ie. 2010)
I don't think it would matter, as QuickFilter appears to only be filtering the data records presented on the browse, without working on the table/set......
Notes: This is a .dbf backend. Difference in speed is about 1/4 of a second versus ~25 seconds as windows pointer "spins" before (eventually) displaying the correct results when using the QueryRun code approach.....
I've also tried to use "between" with Query Run instead, but I've encountered difficulty "encoding" the query correctly..... This may also help with regards to LQO? (But still nowhere as fast as QuickFilter)......
I've been able to accomplish what I need with the following line of code attached to button on a form, based on a parent/child/grandchild set:
(The problem is, it's slow as molasses even after setting the tables index. ~ Although maybe I need to set the index somehow differently as it's a child table of the set the form is based on?)
Code:
topparent.QueryRun("Points_TBL->DATE >= {" + dtoc(vd_StartDate) + "} .AND. Points_TBL->DATE <= {" + dtoc(vd_EndDate) + "}","","","NO","Points_TBL",.t.,"") 'Points_TBL is the grandchild table on form. Parent-->Child-->Points_TBL
By comparison, I can embed a calculated field on the form to show only the year. And "right clicking" on a field in the child browse and then selecting "QuickFilter" is "rocket-fast... (But it's a user based action that way.) ~ Isn't there any way to apply the "QuickFilter" on a browse column & assign the QuickFilter value via code? (This is just for display purposes, to limit the information presented to user.)
The only thing I haven't yet tried is to use topparent.QueryRun with an embedded browse calculated field that only shows the year. (ie. 2010)
I don't think it would matter, as QuickFilter appears to only be filtering the data records presented on the browse, without working on the table/set......
Notes: This is a .dbf backend. Difference in speed is about 1/4 of a second versus ~25 seconds as windows pointer "spins" before (eventually) displaying the correct results when using the QueryRun code approach.....
I've also tried to use "between" with Query Run instead, but I've encountered difficulty "encoding" the query correctly..... This may also help with regards to LQO? (But still nowhere as fast as QuickFilter)......
Comment