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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with refreshing pageframe pages.

Status
Not open for further replies.

bigdavidt

Programmer
Feb 12, 2004
52
US
I have a VFP 6 form with one parent table, three child tables, and two grandchild tables. My form has a page frame, with each page displaying from one of the tables. There are no links among any of the tables, and no cursors in the data environment. Instead I open the tables with code in the Load method. There can be several records in each of the child tables (for instance, a series of items) that match a record in a parent table. The form is intended to operate over a network.

Filters are originally set by code in user-created methods use SET FILTER to insure that the appropriate records are visible.

I have been able to speed up my form in several ways:

? I only refresh the active page of the page frame. I do this with a CASE statement in a method I created that determines which page is the active page and then refreshes it.
? Rather than use alias names in the filter condition, I save the value of the key field in a variable, and then use this value to filter the child records. The code for doing this is in a method I created.
? I have an additional method containing similar code for filtering grandchild records with respect to the child records.
? I only run filtering for the tables relevant to the active page of the page frame. I use CASE statements in another method I defined to determine what tables to filter.

*Code for filtering child records.
PARAMETERS tablename
pkey = ptable.pono
SELECT & Selects the table to be filtered.
SET FILTER TO pno = pkey &&ptable.pno
LOCATE


*code for filtering grandchild records.
PARAMETERS tablename
pitemkey = ctable.pno + ctable.pitem
SELECT &tablename
SET FILTER TO pno+pitem = pitemkey &&ctable.pno + ctable.pitem
LOCATE

The form works correctly, with one exception. The pages showing the grandchild records refresh only if I click onto one of the other pages and then click back again. This is a problem whether I first open the form or scroll from one record to another record.

Can anybody suggest ways to solve this problem?
 
One way of handling the fact that ThisForm.Refresh() doesn't refresh individual pages on a pageframe, is to add This.Refresh() in the Activate method of each page - no complex cases needed!

Rick
 
I have tried something like this:

THISFORM.Pageframe1.page2.REFRESH

I have also tried something like this:
THIS.REFRESH

I still have the same problem.
 
hello bigdavidt,

have you already tried

thisform.pageframe1.activepage=2
thisform.pageframe1.page2.refresh
 
I have. The problem is that when I navigate to other records, the grandchild pages do not refresh. They only refresh whn I click off of the grandchild pages and then back onto them.
 
Sometimes the grids themselves don't refresh until they obtain focus.
Maybe try:
Code:
thisform.pageframe1.page2.[COLOR=blue]Grid1.refresh[/color]
thisform.pageframe1.page2.[COLOR=blue]Grid1.SetFocus[/color]
This.Setfocus

-or-

Maybe set the refresh on momentarily while the user is navigating records:

SET REFRESH TO 1,1


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top