Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing Related Objects
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Refreshing Related Objects
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01282697
Message ID:
01282697
Views:
55
I am having one heckuva problem fully refreshing the related objects. I have Wire Tests (CERTS) and their related Specifications table which are related. I am using these objects on Page 1 of a PageFrame. It seems a real bear to get these objects, all of them, to refresh and display the correct data.

CERTS is related to SPECS through the product number.

It seems that even though I have created a form level method specifically naming each related object, which has disabled text boxes for displaying the data, when I navigate one way, using say NEXT, everything seems to appear properly, but when I use the PREVIOUS button, which calls the same method as the NEXT button, I either don't see a change in the data, or not everything re-displays; this is like a HAUNTED FORM.

Is there some kind of a problem with re-displaying objects on a Page of a PageFrame, or did I just miss something?

This is the code for a direct refreshing of the SPECS objects:
WITH ThisForm.cpageframe1.cPage1
	.txtDiaLo.Refresh()
	.txtDiaHi.Refresh()
	.txtOOR2.Refresh()
	.txtBrkLo.Refresh()
	.txtBrkHi.Refresh()
	.txtTensileLo.Refresh()
	.txtTensileHi.Refresh()
	.txtCastLo.Refresh()
	.txtCastHi.Refresh()
	.txtHelixLo.Refresh()
	.txtHelixHi.Refresh()
	.txtTorsion2.Refresh()
	.txtElong2.Refresh()
	.txtBend.Refresh()
	.txtWrap.Refresh()
ENDWITH
Here's the code in my NEXT Button:
DODEFAULT()

WITH ThisForm.cpageframe1
	IF .activepage=1
		ThisForm.Clear_Validation_Question_Marks()
		.cPage1.Refresh()
		.cPage1.grdCerts.SetFocus()
	ELSE
		.cPage2.Refresh()
		.cPage2.ws1TextBox.SetFocus()
	ENDIF
ENDWITH

WITH ThisForm
	.txtDateTimeLastUpdate.Refresh()
	.RefreshSpecs()
ENDWITH
Here's the hidden Parent Code for the NEXT button:
WITH ThisForm
	IF .IsChanged()
		.SaveIt()
	ENDIF
	IF EOF()
		GO BOTTOM
		.bottomButton.Enabled = .F.
		.nextButton.Enabled = .F.
	ELSE
		SKIP
		IF BOF()
			.topButton.Enabled = .F.
			.previousButton.Enabled = .F.
		ELSE
			.topButton.Enabled = .T.
			.previousButton.Enabled = .T.
		ENDIF
		.bottomButton.Enabled = .T.
		.nextButton.Enabled = .T.
	ENDIF
	.IsDeleted()
	.CountRecs() && Executes a Form refresh also.
ENDWITH
<pre>

Here's the code for the PREVIOUS button:
<pre>
DODEFAULT()
WITH ThisForm.cpageframe1
	IF .activepage=1
		ThisForm.Clear_Validation_Question_Marks()
		.cPage1.grdCerts.SetFocus()
		.cPage1.Refresh()
	ELSE
		.cPage2.ws1TextBox.SetFocus()
		.cPage2.Refresh()
	ENDIF
ENDWITH

WITH ThisForm
	.txtDateTimeLastUpdate.Refresh()
	.RefreshSpecs()
ENDWITH
Here's the Parent Code for the PREVIOUS Button:
WITH ThisForm
	IF .IsChanged()
		.SaveIt()
	ENDIF
	SKIP -1
	IF BOF()
		LOCATE
		.topButton.Enabled = .F.
		This.Enabled = .F.
	ELSE
		IF NOT EOF()
			.nextButton.Enabled = .T.
			.bottomButton.Enabled = .T.
		ELSE
			.nextButton.Enabled = .F.
			.bottomButton.Enabled = .F.
		ENDIF
		.topButton.Enabled = .T.
		.previousButton.Enabled = .T.
	ENDIF
	.IsDeleted()
	.CountRecs()
ENDWITH
Next
Reply
Map
View

Click here to load this message in the networking platform