Hi, Klatuu (is that your real name? Kewl! Sounds a lot like "Klaatu barada
nikto"!
http://www.tauspace.freeserve.co.uk/day_the_earth_06.htm <g>)
Well, for the first time I got somewhere in the Access vb editor <vbg>.
That's saying a lot as it's so different from Excel! <phew>
I created the Autoexec "macro", which newbie-speak for me just means I tried
to put the coding in the vb editor. I've always just called them macros but
I'm guessing that that's probably the wrong word. Anyway, no matter where I
put it, nothing worked so I'm obviously doing something wrong. I'm flying
blind, though, you see. All the code I've looked at in all the examples
I've opened so far have the switchboard open via the startup so it's hard to
visualize what I've never seen. I stuck that Autoexec code _everywhere_; in
various forms, esp. the switchboard vb coding area, and even in module1. No
luck. _But_, I did finally see 2 references in one of the "macros" in the
"Form_Open" one in the switchboard - one line reference says
' Minimize the database window.
and the other says:
' Move to the switchboard page that is marked as the default.find by
the forms ...
So it seems that that works. I put the switchboard back on in startup and
this in the switchboard code area at the top and at least the database
window is now minimized with this code, which I've copied here below:
******************************
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
******************************
You've all been so very patient and I really appreciate that. Hopefully,
though, I can end the day on even more positive results and hope you don't
mind - is there a way to make the switchboard maximize somewhere in the
above code? I find that if it's in that state, any forms I then open from
the switchboard will all be maximized which is good for us. Our forms in
this solution are rather heavily populated with items (fields and sub-forms)
so we can see really only see it all comfortably when the screen is
maximized. (I'm not the developer, she's done a fabulous job but I'm just
fixing my front-end to be much more user-friendly).
I'll worry tomorrow or another day about that table you speak of. I think
that's a great idea but don't know where I'm heading with that yet to make
it happen. I feel confident for the first time in making more headway with
an Access manual and will go again to the library to see what they have
again.
Thanks so much and appreciate everyone's help and hopefully that "macro"
above can accommodate a maximize command!
D
Klatuu said:
There are no Macros in the VB Editor. The VB Editor gives you access to the
VBA code in your application.
You create any code within the Switchboard. It is just an easy way to
create a Form based menu system.
To do what you want to do will not be that difficult. You can remove the
reference to the Switchboard in the Display Form/Page: and create a Macro
named Autoexec. When Access starts up and there is no form or page
identified, then it looks for a macro named Autoexec and runs it.
You could open the table minimized, then run your Switchboard from the macro.
Now, you have stumbled on one of the performance tricks of Access. Certainly
having the main table open will let you get to it faster, but, it would not
have to be that table. One of the performance tricks of developing an Access
application is on start up to open any old table. Many developers use a
catch all table that might keep information they need for the application,
but isn't used by the users. They keep this table open as long as the mdb is
open. This is called a "persistant" connection. It makes opening any other
table in the back end database much faster, because the front end database
does not have to go find the back end each time there is a request to open a
table.
I would suggest you consider such an approach. There are down sides to
keeping your main data table open all the time, but that is for another topic
session.
out in
(still do, though feeling a little better <g>).
[snip]