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

Menu addressing objects on forms.

Status
Not open for further replies.

scottcederlof

Programmer
Dec 19, 2003
1
US
I am trying to access different forms in an application using a custom menu. I can access anything on the active form by using the _screen.activeform.AnyObjectGoesHere.DoAnythingIwant command. I can't figure out how to get to the other forms that are open but not active especially in a formset. In the above example is there a way to substitute the word 'activeform' with the name of the form I am interested in modifying? Actually I tried that and I couldn't get it to work?
 
What do you mean by a "custom menu"? Are you talking about a menu you created in the menu builder, or are you talking about options you've put on a form? From the rest of your description, it sounds like some kind of options you've put on a form. What are these options? Are they command buttons or what? What kind of code do you call when one of them is selected?

It's generally not a good idea to use formsets. They're mainly for backwards compatibility with 2.x screen sets. I've found very few occassions when a formset is appropriate, and as someone who's participated in VFP alpha and beta tests, I can tell you they aren't tested that well.



-BP
 
Or, you can use something like:

Public FirstForm, SecondForm
...
do form MyFirstForm name Form1
FirstForm=Form1
...
do form MySecondForm name Form2
SecondForm=Form2

&&Menu
..
FirstForm.Caption='***'

Good luck!
 
HI


_screen.activeform.AnyObjectGoesHere.DoAnythingIwant command. I can't figure out how to get to the other forms that are open but not active especially in a formset.


From within the form..

This.Parent.Form2.command/event

The same way..

_screen.ActiveForm.Parent.Form2.Command

You can also use..
DO FORM myFormSet NAME myFormSet LINKED
Then.. from screen..
? myFormSet.Form1.Name
? myFormSet.Form2.Name
myFormset.Form2.Click

etc..

:)


____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top