 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 25th, 2005, 11:18 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Close the VB editor
Hi all,
I'm working on a procedure that dynamically creates a form. I've also added events, and modules to the form dynamically. My problem is, when I generate the form, and open it, use it and close it, the vb editor window is still visible. Does anyone know how to close it down, after the form and all it's events and modules have been generated?
Thanks in advance for your help!
Kevin
dartcoach
__________________
dartcoach
|
|

November 28th, 2005, 01:49 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
That's unusual. The VB Editor opens when you run the form? I have never heard of that. What is opening the VB window?
mmcdonal
|
|

November 28th, 2005, 10:01 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
mmcdonal,
What's actually happening is that I'm generating a form with combo boxes, and I never know how many I'm going to create because it's based on a table that can grow. Once a user clicks on a button on my main form, the code creates the form, the correct number of combo boxes and additional on open and on close events for the form. It then closes the form and reopens it in maximized view for the user to utilize. My problem, is that the vbeditor is open, behind the main form, once the generated form is closed by the user. The code that's in the window is the code behind the button on my main form.
Does this make sense?
Kevin
dartcoach
|
|

November 29th, 2005, 01:36 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
What does that code say? I never heard of the editor popping up on its own.
mmcdonal
|
|

November 29th, 2005, 09:53 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I haven't either. Everything is normal, the main form is open, all other forms are closed. When I click my button, it performs exactly as designed except for when I close the generated form, the code behind the button stays visible behind the main form.
There is no message from the system or any popups, so I don't know how to track why it's staying open.
Thanks for your help,
Kevin
dartcoach
|
|

December 7th, 2005, 12:45 AM
|
|
Registered User
|
|
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
It had me going for a while also. I added the following code to the Open event of the new form and it closes the VBE
Private Sub Form_Open(Cancel As Integer)
Application.VBE.MainWindow.Visible = False
End Sub
|
|

December 7th, 2005, 07:49 AM
|
|
Friend of Wrox
|
|
Join Date: Dec 2005
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
BPort, after that code has run are you able to re-open VBE without coding in a .Visible = True statement somewhere else? When I was running an Excel parser I used .Visible = False for that but if it did not reach the Close statement it would remain open and invisible in the background until I killed the process.
|
|

December 7th, 2005, 12:38 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hey guys!
We're getting closer! I'm able to close the actual code panes using a For loop. That still leaves the Main window. Kindler, I agree with you, about making sure that the visible property is reset to true somewhere.
Thanks for your help so far!!
Kevin
dartcoach
|
|

December 7th, 2005, 12:52 PM
|
|
Friend of Wrox
|
|
Join Date: Dec 2005
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Solved my own question, Alt-F11 brought the VBE back up after executing Application.VBE.MainWindow.Visible = False with no problem. I'd go with BPort's solution as the fast & easy method.
|
|
 |