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

Controlling VBA editor window

Status
Not open for further replies.

rfitch

Programmer
Nov 20, 2003
5
0
0
US
In MSAccess I am writing a module that will update a vba module by replacing the lines with lines stored in an Oracle table. This enables remote users to get updates without a network share.
The problem is to create a Module object
(set mdl = Modules(modulename)) I have to open the module first (DoCmd.OpenModule modulename). This opens the vba editor which stays open after the module has been modified and closed.
Is there a way that my users never have to see the vba editor?
 
Hi,

How are you adding the new text? I just tried the code below, and it worked without opening the VBA Editor.

Code:
Private Sub Command0_Click()
    With Modules("modTest")
        .InsertLines .CountOfLines + 1, "' Test !!!"
    End With
End Sub
Dean :)
 
Dean, I tried your code and it doesn't work unless the referenced module is already open. Close Access. Re-open the database, press alt-f11 to bring up the vba editor. I think you'll find that the module your program is writing to is open in the editor. If you try to write to another module that does not come up open, you'll get an error.
If your code writes to a module that would be open if you open the editor, it works fine and does not open the editor.

The
Code:
 Modules("modTest")
cannot find modTest unless it has been opened manually or with
Code:
 DoCmd.OpenModule("modTest")
first.

You will also find that Modules.count returns the number of modules already open.

So what I really need is a way to make the editor window hidden or Minimized when it opens and a way to close it afterwards.
Rick
 
Does anyone else have any idea how to make the editor window hidden or how to open a module without the editor window coming up and staying open after closing the module?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top