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

nguyen12

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi All. I need help. I have a form connect to another form when the user select the proper option, my problem is that when i am existing form number 2 and return to form number 1, then i can't open form number 2 from form number 1 again. I am thinking about using a for loop in form number 1 to let the user have the ability to user the same option over and over again. Can someone give me an example how to write a loop to control option button group, where can i write the loop? Should it be in the valid event of the form or in the program. Thank you.
 
I don't see why you can't just put "DO FORM myForm2" in the option button's click event and have it open the form every time.
 
I tried your method. But it did not work. Is ther any other method to do it?
 
What is happening the second time you try to load the second form? Nothing? Are you getting an error message? Could the second form's visible property somehow be getting set to .F.? Is the second form actually showing up underneath the first form? There are so many things that can be going on here.
 
I've seen this question a few times now in the last few weeks. The actual setup of the forms seems kinda confusing.

Can you post the ENTIRE procedure that contains the call to Form2 including exactly which method it is that calls it? (Ex. form1.optiongroup1.option2.click)

I use forms like this all the time and I never have any problem calling the form as often as I like. I use "DO FORM Form2". Perhaps if we see exactly what the code looks like we can give you some tips.

Ian
 
Here is what i do. In the first form i set form visible to .f., and then i use the command release thisform, and then release the window name. in form 2 i have three button, so i set case for each button like case 1 do something, case 2 do something, case 3 i will hide secondform and then calling form 1 by the command do form form1 name form2 linked, and then endcase. After that i set release window name. I want to set option to open form 2 from form1 as many times as i like. But i could only open one time only. Any ideas. Thanks
 
Oh my...that sounds far more complex than it needs to be.

Try this:

Don't hide any forms. Start the form with the buttons, but do NOT call Form1.

Set Form1's WindowType property to 1-Modal.

When CASE 3 comes up, "DO FORM form1". You shouldn't need the LINKED keyword.

As long as Form1 is active, you cannot switch back to the one with the buttons. As soon as you close Form1, the focus will go right back to the one with the buttons. You can then call it again if you like.

Ian
 
Create the forms that dont work in a small test project.

Email me the project and I will try to figure it out for you.

mark@ccspecial.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top