How to display a form and hide the rest.

C

cr113

I'm developing an Access application and I want to make it look like a
real app by only displaying the form and none of the menu windows. I
tried unchecking everything under Tools/Startup but it still displays
the main window with File Edit View etc. I also tried executing the
Application.Visible = False command in the Form_Load event but that
gave me an error.

So my question is what is the correct way to make Access look like a
real windows application.
 
C

cr113

I'm developing an Access application and I want to make it look like a
real app by only displaying the form and none of the menu windows. I
tried unchecking everything under Tools/Startup but it still displays
the main window with File Edit View etc. I also tried executing the
Application.Visible = False command in the Form_Load event but that
gave me an error.

So my question is what is the correct way to make Access look like a
real windows application.

I forgot to mention that I'm using Access 2003.
 
J

Jeff Boyce

If you want Access to display a particular form on startup, you need to tell
it which form to use.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
C

cr113

If you want Access to display a particular form on startup, you need to tell
it which form to use.

Regards

Jeff Boyce
Microsoft Access MVP

Right, but how do I display that particular form and nothing else? I
don't want to show the main Access window.
 
J

Jeff Boyce

We're not there. We can't see what you're seeing.

You "don't want to show the main Access window" ... what do YOU mean by
that? When I use a startup form, that form opens, not the "main Access
window" (per my definition)...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

If you want Access to display a particular form on startup, you need to
tell
it which form to use.

Regards

Jeff Boyce
Microsoft Access MVP

Right, but how do I display that particular form and nothing else? I
don't want to show the main Access window.
 
C

cr113

We're not there.  We can't see what you're seeing.

You "don't want to show the main Access window" ... what do YOU mean by
that?  When I use a startup form, that form opens, not the "main Access
window" (per my definition)...

First off I'm using Access 2003, maybe that makes a difference? Anyway
if I open a typical Access .mdb file I can see a "main" window with an
Access menu across the top that says, "File Edit View Tools". Inside
of that window I can usually see tables or queries or forms depending
on which I choose. I don't want my application to show any of that. I
only want to show the form I created. Currently I can see my newly
created form on top and behind it I can see what I call the main
Access window with "File Edit View Tools" displaying across the top. I
only want to see my form and the desktop behind it.
 
J

John W. Vinson

First off I'm using Access 2003, maybe that makes a difference? Anyway
if I open a typical Access .mdb file I can see a "main" window with an
Access menu across the top that says, "File Edit View Tools". Inside
of that window I can usually see tables or queries or forms depending
on which I choose. I don't want my application to show any of that. I
only want to show the form I created. Currently I can see my newly
created form on top and behind it I can see what I call the main
Access window with "File Edit View Tools" displaying across the top. I
only want to see my form and the desktop behind it.

Open the database; select Tools... Startup from the menu. Uncheck "Display
Database Window". You may want to also uncheck "Use Access Special Keys" or a
knowledgable user (or a lucky one) will be able to press F11 to bring up the
database window in your despite.
 
D

Dirk Goldgar

cr113 said:
First off I'm using Access 2003, maybe that makes a difference? Anyway
if I open a typical Access .mdb file I can see a "main" window with an
Access menu across the top that says, "File Edit View Tools". Inside
of that window I can usually see tables or queries or forms depending
on which I choose. I don't want my application to show any of that. I
only want to show the form I created. Currently I can see my newly
created form on top and behind it I can see what I call the main
Access window with "File Edit View Tools" displaying across the top. I
only want to see my form and the desktop behind it.


You can use the function posted here to hide the application window:

http://www.mvps.org/access/api/api0019.htm
API: Manipulate Access Window

However, the forms you display must be both PopUp *and* Modal (not mentioned
in the article), and you must ensure that the form is visible before calling
the function.

I must say, though, that this has very limited applicability because it's
very cumbersome to use, unless your application really only has one form to
display at a time. I have an application in which the main function is
controlled by a single form, which is displayed "standalone" using this
technique. But when the user requests any other functions, especially
reports in print preview, I show the application window again to make it
easier to work with them. Then, when the user is done and returns to the
main form, poof! the application window is hidden again.

Most of the time, though, it's perfectly acceptable to display your
application's workspace inside the application window.
 
C

cr113

The only option I usually have checked in the Startup options is Allow
Toolbar/Menu Changes.  This is aside from any startup form and toolbar
selections.

I have Access 2003, and have not found a way not to display the default menu
bar except by selecting a custom menu.  If I don't want to see that menu
either I put something like this in the form's Activate event:

DoCmd.ShowToolbar "ToolbarName", acToolbarNo

I have also found applications where I placed the above code in the Load
event.  To tell the truth, I am not sure which is best.  I do know I have
struggled more than should be necessary with this very problem.

I decided to do this project in Excel and just use Access as the back
end database. So far I like programming in Excel much better than
Access. It "flows" a lot better. It's easier to switch between the
code module and form (F7 - shift F7), plus it's easier to run (F5).
Also the control properties are closer to Visual Studio's programming
controls. To display only the form you just need to execute the
Application.Visible = False command.

Thanks for the info!
 

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