The Problem
I want to close the VBE window via code...
I am hoping to avoid an API call but if not, pointing to the right API(s) would be helpful.
Why it is open in the first place
I am creating a form and creating it's associated module in code.
This causes the VBE window to open. Even after I close the module, the VBE window remains open with other modules open.
I suspect these just happen to have been used since the application started.
[red]Why I'm doing things this way... (someone will ask)[/red]
I am writing a replacement Access application for an old VB6 program with missing source code that uses an Access backend.
The data is not normalized but for Legacy support I have persisted with same layout. This was clearly written by someone that thinks of tables as placeholder for array data vs. normalization.
Data entry requires key mapping of the numeric keypad which I was only able to accomplish by adding KeyDown and Change events on a varying number of controls
I want to close the VBE window via code...
I am hoping to avoid an API call but if not, pointing to the right API(s) would be helpful.
Why it is open in the first place
I am creating a form and creating it's associated module in code.
This causes the VBE window to open. Even after I close the module, the VBE window remains open with other modules open.
I suspect these just happen to have been used since the application started.
Code:
'strFrmName is a name of form passed to procdure
Dim frm As Form
Dim ctl As Control
Dim mdl As Module
Dim i As Long
DoCmd.Echo False
DesignAndReplaceForm (strFrmName) 'Deletes form if it exists and creates empty form
DoCmd.OpenForm strFrmName, acDesign
Set frm = Forms(strFrmName)
Set mdl = Forms(strFrmName).Module
'Code that adds controls here
'Code that adds code to the module here
DoCmd.Close acModule, mdl.Name, acSaveYes
Set frm = Nothing
DoCmd.Close acForm, strFrmName, acSaveYes
DoCmd.Echo True
'VBE Window still open
[red]Why I'm doing things this way... (someone will ask)[/red]
I am writing a replacement Access application for an old VB6 program with missing source code that uses an Access backend.
The data is not normalized but for Legacy support I have persisted with same layout. This was clearly written by someone that thinks of tables as placeholder for array data vs. normalization.
Data entry requires key mapping of the numeric keypad which I was only able to accomplish by adding KeyDown and Change events on a varying number of controls