Docmd.DoMenuItem

  • Thread starter Thread starter Souris
  • Start date Start date
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,
 
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.
 
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,
 
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.
 
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

Similar Threads

vba coding 4
acEditMenu help 1
Error 2237 8
DoMenuItem Error 1
Programatically manipulate Form Menu in Design Mode 4
docmd.close 1
write conflicts 1
Duplicating Multiple records in a form 7

Back
Top