Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refrshing form a form form b
Message
From
28/03/2000 03:29:07
 
 
To
27/03/2000 18:03:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00351081
Message ID:
00351285
Views:
18
Hi Claude.

>This an exsting application. I did not write it. Form a is used to gather
>information items in a location. Application has an independent form for
>display items for a given location. It is not called from form a but from a
>menu bar. User would like to click on an item in form b and see data for it
>in form a. How do I refresh form a from form b?

If both of your form's are running in private datasessions, this could get a little messy. What you would need is for each for to hold an object reference to the other, making sure to set the object reference to .NULL. in the destroy of each form. If both form's are modeless, presumably, the user could open form A, then open Form B, and then close form A. So issuing a

Thisform.oFormA.Refresh()

from form B in this case would cause an error since Form A has been released.

You can set up the object references in the load of formB like this:
LOCAL loForm
loForm = .NULL.
FOR EACH loForm IN _Screen.Forms
  IF loForm.Name == '< The Name of Form A >'
     Thisform.oFormA = loForm
     loForm.oFormB = This
     EXIT
  ENDIF
ENDFOR
Then, when you want to refresh form A from form B, you use code like this if both forms are using the default datasession. If they are using private datasessions, you must have a way to position the data in form A's data session from within form B.
IF !IsNull( Thisform.oFormA )
  Thisform.oFormA.Refresh()
ENDIF
HTH

Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform