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

Refreshing forms

Status
Not open for further replies.

jerold

Programmer
Aug 30, 2000
52
PH
Form1 uses table1 & has cmdSearch that opens form2.
Form2 has cmdOK that performs record changes
on table1 and then releases form2.
Please help on how I could refresh form1
inside cmdOK.click. Orgive me an alternative
code setup regarding this problem.

Thank you very much.
 
** Form1
DEFINE CLASS Form1 AS Form
lRefreshData = .F.
procedure Activate
if this.lRefreshData
* refresh form data after form2 close
endif
endproc
.....

** Form 2
....
procedure cmdOk.Click
Form1.lRefreshData = .T.
thisform.Release()
endproc
....
 

If you are using tables/database controls/objects and
doing updation/correction say using sqls you need not
bother about the refreshment of the form. The data in the
form will get automatically refreshed.
Otherwise follow Mr ThomasDill's solution if that is not
the case.

Bye
phani
 
The root of jerold's question is: how do I reference Form1 from Form2?

In order to do this, you'll need an object reference to Form2 that is available to Form1. The easiest and simplest way is for Form1 to pass a reference to itself to Form2.

[tt]* Form1.cmdSearch.Click
do form Form2 with ThisForm

[/tt]
Create a new form property in Form2 called "oCallingForm"

[tt]* Form2.Init
lParameter toCallingForm
this.oCallingForm = toCallingForm

* Form2.cmdOK.Click
ThisForm.oCallingForm.Refresh()[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top