Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 25th, 2005, 11:18 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default 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
Reply With Quote
  #2 (permalink)  
Old November 28th, 2005, 01:49 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old November 28th, 2005, 10:01 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Reply With Quote
  #4 (permalink)  
Old November 29th, 2005, 01:36 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What does that code say? I never heard of the editor popping up on its own.


mmcdonal
Reply With Quote
  #5 (permalink)  
Old November 29th, 2005, 09:53 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Reply With Quote
  #6 (permalink)  
Old December 7th, 2005, 12:45 AM
Registered User
 
Join Date: Dec 2005
Location: Chicago, IL, Afghanistan.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #7 (permalink)  
Old December 7th, 2005, 07:49 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: , , .
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
  #8 (permalink)  
Old December 7th, 2005, 12:38 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Reply With Quote
  #9 (permalink)  
Old December 7th, 2005, 12:52 PM
Friend of Wrox
 
Join Date: Dec 2005
Location: , , .
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frustration with VB Editor jeremy1048 Access 3 October 26th, 2007 01:10 PM
VB Editor Format Setting dpkbahuguna Beginning VB 6 5 September 26th, 2007 11:07 AM
Word Editor in VB and integrating to Access table akash VB How-To 1 April 11th, 2005 08:19 AM
Microsoft VB Editor question edray Beginning VB 6 0 July 13th, 2004 03:25 PM
Menu editor in VB 4 Zooker Beginning VB 6 1 July 9th, 2003 10:08 AM



All times are GMT -4. The time now is 04:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.