Using MS Access/Command buttons


Hi Scott

Back again, this time seeking assistance with a command button.

I have two forms, one frmSplash, the other frmMain.

On opening the database, the frmSplash is virtually a welcome screen giving some detail of the database. The other form frmMain is the Main Menu for the database.

On the frmSplash form I have a command button. If I use the wizard to create the button, Access does this, successfully I might add. On clicking the button on the splash screen it opens the Main Menu.

What I want the button on the Splash screen to do however is to open the Main Menu and close the Splash screen.

I canít seem to be able to edit the macro produced for the on click event to do this successfully; is this possible? If so how do I go about it?

Maybe I would be better off using VB code. Once again could you help with this please?

Many thanks Scott



Sorry, this slipped past me.

In VBA its easy. After the OpenForm method add:

DoCmd.Close acForm, "formname", acSaveNo

In macros there should be a Close Action that will do the same.

Hope this helps,
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers

Answers by Expert:

Ask Experts




I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.


I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Brooklyn College BA

©2016 All rights reserved.