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!

Having trouble releasing a form.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
At startup of my program I open a form that, if certain conditions are met, will open another form. Both of the forms have the same ShowWindow property of 2-As Top Level Form. I use the code below to test the condition and open the second form. The problem is that although the second form opens the initial form also stays open. Can someone look at the code below and offer suggestions.

if mpwd=currpwd
thisform.release()
do form mainform
endif


I've also tried reversing the sequence of commands. As in:

if mpwd=currpwd
do form mainform
thisform.release()
endif


This doesn't work either.
 
Because the first form is the creator of the 2nd, it will hold a reference to the 2nd. Until this reference is released (when the 2nd form is released), the first can't be released. You'll either need to just hide the first form, or use a program to fire up both forms.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top