Access Switchboard

T

Tom

I need to make some modifications to the code of the Access Switchboard.

Currently, the function below minimizes the Switchboard but leaves the
Switchboard form open (not sure if I use the right terminology here... maybe
it minimizes the Database Window and leaves the Switchboard form open).

Anyhow, in the Startup screen, I have deselected all possible checkmarks,
but selected "Switchboard" for the "Display Form/Page:".

Now this is what happens when the end user opens up the database.
- Almost all toolbars disappears - which is desired
- The actual Switchboard form is activated - which is desired
- The (whatever it's called...) Switchboard or Database window is
minimized - I do NOT want that. I rather also have that one minimized
option "disappear". That will reduce the chances that end-users have an
opportunity to access any tables, forms, queries, etc. (unless they
press/hold SHIFT when opening the application... most of the users won't
know that shortcut though... I hope so at least).

So, my questions are the following:

1. How can I modify the Form_Open function so that everything disappears
from the screen except the "actual" Switchboard.

2. Also, even though I unchecked all options from the Startup menu (e.g.
"Allow Full Menu" etc), I still see the "File, Window, Help" in the toolbar.
Yes, the options have been quite reduced but still I think I don't want to
show any options in the toolbar. Does anyone know how to excluded these 3
options ("File, Window, Help") as well?

Thanks,
Tom



&&&&&&&&&&&&&&&&&&&&&&&&&&&

Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
On Error GoTo Form_Open_Err

' Minimize the database window.
DoCmd.SelectObject acForm, "Switchboard", True
DoCmd.Minimize

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

Form_Open_Exit:
Exit Sub

Form_Open_Err:
MsgBox Err.Description
Resume Form_Open_Exit

End Sub
 
J

Jeff Conrad

Open the Switchboard code module.
These are the lines you do not need:

DoCmd.SelectObject acForm, "Switchboard", True
DoCmd.Minimize

Comment out those lines, compile the code, and save the form.
Now the Database Window should not appear when you start the database.
 
T

Tom

Jeff:

Thanks, that works great. Out of curiosity, I did not "compile" the code
(simply because I don't know how to do that). It worked w/o anyways... or,
can I expect some errors later on, so I must compile it now.

Any additional pointers? Also, do you happen to have an idea about
excluding the remaining options on the menu (File, Edit, etc.).


--
Thanks,
Tom


Jeff Conrad said:
Open the Switchboard code module.
These are the lines you do not need:

DoCmd.SelectObject acForm, "Switchboard", True
DoCmd.Minimize

Comment out those lines, compile the code, and save the form.
Now the Database Window should not appear when you start the database.

--
Jeff Conrad
Access Junkie
Bend, Oregon

I need to make some modifications to the code of the Access Switchboard.

Currently, the function below minimizes the Switchboard but leaves the
Switchboard form open (not sure if I use the right terminology here... maybe
it minimizes the Database Window and leaves the Switchboard form open).

Anyhow, in the Startup screen, I have deselected all possible checkmarks,
but selected "Switchboard" for the "Display Form/Page:".

Now this is what happens when the end user opens up the database.
- Almost all toolbars disappears - which is desired
- The actual Switchboard form is activated - which is desired
- The (whatever it's called...) Switchboard or Database window is
minimized - I do NOT want that. I rather also have that one minimized
option "disappear". That will reduce the chances that end-users have an
opportunity to access any tables, forms, queries, etc. (unless they
press/hold SHIFT when opening the application... most of the users won't
know that shortcut though... I hope so at least).

So, my questions are the following:

1. How can I modify the Form_Open function so that everything disappears
from the screen except the "actual" Switchboard.

2. Also, even though I unchecked all options from the Startup menu (e.g.
"Allow Full Menu" etc), I still see the "File, Window, Help" in the toolbar.
Yes, the options have been quite reduced but still I think I don't want to
show any options in the toolbar. Does anyone know how to excluded these 3
options ("File, Window, Help") as well?

Thanks,
Tom



&&&&&&&&&&&&&&&&&&&&&&&&&&&

Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
On Error GoTo Form_Open_Err

' Minimize the database window.
DoCmd.SelectObject acForm, "Switchboard", True
DoCmd.Minimize

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

Form_Open_Exit:
Exit Sub

Form_Open_Err:
MsgBox Err.Description
Resume Form_Open_Exit

End Sub
 
F

fredg

Jeff:

Thanks, that works great. Out of curiosity, I did not "compile" the code
(simply because I don't know how to do that). It worked w/o anyways... or,
can I expect some errors later on, so I must compile it now.

Any additional pointers? Also, do you happen to have an idea about
excluding the remaining options on the menu (File, Edit, etc.).

To "compile" code, while you are in the VBA code window, all you need
do is either click on Debug + Compile or click on the Compile tool
button (looks like a stack of papers with a down arrow on it).
It literally checks your code for syntax and coding errors and
highlights any line which does not compile. It's always best to find
out you have a problem sooner, rather than later.
 
J

Jeff Conrad

Hi Tom,

Fred answered your question about compiling, I'll answer
the one about removing the File, Edit, etc. options from
the menu bar.

You don't want to mess with the built-in Access menu
bars/toolbars. This will affect all databases. What you
want to do is create your own menu bars/toolbars with all
the functions you would like to see. You can then leave
out any options you do not wish to see. Creating menu bars
and toolbars is actually quite fun once you get the hang
of it. It also adds a nice "polished" look to your
application.

To study up on this topic I would suggest the following
great article. It is written for Access 97, but the same
basic concepts apply to later versions as well.

http://www.microsoft.com/Accessdev/articles/bapp97/chapters
/ba01_6.htm

(Watch out for line wrapping, that link should all be on
one line in your browser)

Good luck,
 

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