Docmd.DoMenuItem

S

Souris

Does Docmd.DoMenuItem support to run Close command on File menu?
I tried to close MS Access application using VBA in the AutoExec macro.
Is it possible to do this?
Your information is great appreciated,
 
M

Marshall Barton

Souris said:
Does Docmd.DoMenuItem support to run Close command on File menu?
I tried to close MS Access application using VBA in the AutoExec macro.
Is it possible to do this?


Check VBA Help on the Quit action/method.

Note that DoMenuItem is an archaic holdover from way back in
Access 2. It has been superceded by other, better ways of
doing things and, if there is nothning else, the RunCommand
method.
 
S

Souris

Thanks for the message,

The Quit method quit the MS Access.
I have startup mian form automatically.
Acess still shows the auto main form before quit application.
Is it possible that MS Access quit without loading startup main form?

Thanks again,
 
M

Marshall Barton

If the form opens before the AutoExec macro performs the
Quit action, then don't make the form the start up form.
Instead put your startup code in a public Function in a
standard module.

Use the RunCode action in the AutoExec macro to call the
function. The function can then contain the code to decide
if it should quit and, if it should continue, open the form.
 
S

Souris

Thanks for the information,

Marshall Barton said:
If the form opens before the AutoExec macro performs the
Quit action, then don't make the form the start up form.
Instead put your startup code in a public Function in a
standard module.

Use the RunCode action in the AutoExec macro to call the
function. The function can then contain the code to decide
if it should quit and, if it should continue, open the form.
--
Marsh
MVP [MS Access]

The Quit method quit the MS Access.
I have startup mian form automatically.
Acess still shows the auto main form before quit application.
Is it possible that MS Access quit without loading startup main form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top