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!

Close Forms 1

Status
Not open for further replies.

007MCSE

IS-IT--Management
Jan 3, 2003
51
US
Is there an Unload command to close all open forms in one go?

Any help would be appreciated
 
1: Your main form ( PPortLC1 ) opens your second form ( LEDcolors )
Correct

2: After selections are made on your second form, you click a button that saves the data and quits, or a button that just quits the second form.
Correct

3: This calls a sub in your main form, that closes ALL forms.
Correct

4: You then recreate a new main form( PPortLC1 ) and show it, using the "Me" keyword.

frmPPortLC1.Show vbModal, Me
correct

The problem here, is that there is no "Me" anymore. All of your forms have been unloaded by calling:

PPortLC1.Close_Forms

a few lines before, so there is no "Me" to reference to.

I don't know why you are going through such a roundabout way of opening forms, but if you get rid of the "Me" at the end of that line, you might fix your problem.
Removing the Me, didn't work

I tryed all the usual Open forms Close forms but it wouldn't work right (see above posts)

I'm getting so frustrated with this. I've never ever had this trouble before just opening and closing forms.

It just dosen't make any sense. The main form I can open and close each time with no problems, but its when I close the subforms.


 
You might also try removing the vbModal from those lines as well. If I'm understanding correctly, you want to be able to open your second form from the main one, right? If you use VbModal to show the main form, then you can't open any other forms until you close it.

Robert
 
Hi Robert

Thank you so so so so much.....That worked
 
Which ( once I thought about it ) explains why it would work the first time, but not the second. The first time you ran your project, the main form is mon-modal. Once you closed and re-opened the main form as modal, that's where you would run into your problem.

You're welcome,

Robert
 
I'm so gratefull

Now i've got all the bugs out of my program, I can carry on with the second phase.

Thanks you so much once again

Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top