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

Replacing Text Box On Another Form's Inactive PageFrame 2

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
0
0
US
Hello,

I have a project in VFP 7.0 (Win XP) where I have a Client Form with a PageFrame Control with multiple pages on it. On Page1 of the PageFrame, I have client's data and a text box containing his work code. Now The User moves onto Page 2, 3, 4 etc. of the pageframe control on this form.

The user uses various control buttons on these other pages which open up small "mini" forms where they enter other data. My problem is that depending on certain answers on these other mini forms, I want to insert values back into text boxes that exist on the 1st Page of the pageframe back on the Client Form.

I get error messages that the property is read only.

Remember, the text boxes I am trying to update back on the Client Form are on an "inactive" page of the pageframe control. Is there a way around this?

Thanks For Your Time,

Dave



The 2nd mouse gets the cheese.
 
Thisform.Pageframe.Page1.TextBox1.Value = SomeValue

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
send your form into the mini form as a parameter...

Do form frmMini with thisform

...then inside the mini-form(s) add the following to the Init Event:

LPARAMETERS tcFormSentIn
thisform.addproperty(originalform, tcFormSentIn)

...now you have a form reference back to the original form and you can use code like TeknoSDS outlined to change the value...

Thisform.originalform.Pageframe.Page1.TextBox1.Value = SomeValue


Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Hi,

I have tried that but that's where the error comes from.
Since its actually running in a seperate .prg I'm using

frm_Client.PageFrame1.Page1.txtWorkCode.text = gcWork

I think the error is because Page1 is no longer the "active" page in that pageframe control.

Any more ideas would be appreciated,

Dave

The 2nd mouse gets the cheese.
 
ok, well then try this hack to test your theory...

Local lnActivePageWas
lnActivePageWas = frm_Client.PageFrame1.ActivePage
frm_Client.PageFrame1.ActivePage = 1
frm_Client.PageFrame1.Page1.txtWorkCode.text = gcWork
frm_Client.PageFrame1.ActivePage = lnActivePageWas



Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Thanks, that helps. But a similar problem has occurred.

I can't replace a text box value on Page1 of my pageframe control from Page2 of the same pageframe control. The actual replace statement is executed from Page2 control which is running a .prg... How Come?

Is it because textbox is not on the active page of the pageframe?

How can I get the replacement to occur if it's a .prg being run from Page2 of the pageframe on the same form?

Thanks Again,

Dave

The 2nd mouse gets the cheese.
 
You could replace the controlsource of the textbox...I mean if you have a variable named "gcMyText" as the controlsource of the textbox then you could just set that variable and not the actual control...just as if the controlsource was a field in a table you could replace the field instead of replacing the textbox's value.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Thank you... a simple solution to the problem.

Dave



The 2nd mouse gets the cheese.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top