Me + Ac2007 = Bull + China Shop

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:11
Joined
Feb 28, 2001
Messages
30,809
I seem to be breaking everything in sight. It is becoming a bit disconcerting. The "problem du jour" is Ac2007 and the menu bar/ribbon bar.

We have a database used for generating huge numbers of action reports after the fact. The data volume is based on about 25,000+ actions per month spread out among maybe 30 people, just to give you an order of magnitude of the data we track. We archive some things after the action has been closed at least 6 months so the BE file doesn't bloat TOO much.

Most of the time it works great. However, there are times when I have to step outside the database to do a manual UPDATE query. Happens once in a blue moon. I found some code regarding hiding the ribbon and menu bars. (See later.) This used to work, but during other rework, I broke that "step-outside-the-box" feature. Here is where we are.

Running Ac2007 on a split FE/BE Ac2003-format database. (Soon to be upgraded, it's on the schedule to do so.) We have a startup form that acts like a combination of traffic cop and switchboard. It has a button that is visible only to supervisory staff to allow us to "step outside the box." This is where I have the problem.

In Ac2007, the developer copy of this database has the menu bar and ribbon until we take a copy of that and finish the customization that turns it into the production version. When we start the developer FE copy, the Window round button, the menus, and the ribbon are visible. To change the developer copy to the production copy, we change these things:

Use linked table manager to point to the production back-end. Maybe 40-50 tables affect. Some very small in the 20-30 rows range (translation tables), a couple quite large - the largest over 200,000 rows.

Then we use the round button (whatever you call that silly thing with the Windows Icon in it) to get to the Access Options page. We set these things as noted:

Application title --> our name for the database
Display form --> the name of our startup form
Display status bar --> unchecked
Use Access Special Keys --> unchecked
Enable Layout View --> unchecked
Enable design changes (in datasheet view) --> unchecked
Disable Navigation Pane --> unchecked

Then we digitally sign the code. We will lock the code later but for now, we do not do so. Since we have a limited number of users at the moment and we know where they all live, we can take care of problem users pretty easily.

At this point we have made it production-ready. The code has a couple of handy windows calls to automagically maximize the apps windows for the main form and for each sub-form. This combination of things pretty much prevents people from breaking through to the database window. Most people see an EXIT button but not a CLOSE button (the "step outside the box" button).

The startup form executes this code during Form_Load:

Code:
        DoCmd.NavigateTo "acNavigationCategoryObjectType"
        DoCmd.RunCommand acCmdWindowHide
        DoCmd.ShowToolbar "Ribbon", acToolbarNo

This works fine. If we have a catastrophic failure and something aborts, the user IS blocked from doing anything useful. The display has keys disabled and no navigation is possible. So they exit and restart the FE. Since there is no permanent data in the FE, no big deal. That works as intended.

However, we have that button to "step outside the box" and that is where the problem arises...

In the special button's on-click routine, we execute this code:

Code:
            DoCmd.NavigateTo "acNavigationCategoryObjectType"
            DoCmd.ShowToolbar "Ribbon", acToolbarYes
            DoCmd.SelectObject acTable, "MSysObjects", True

After that, the form closes. But we don't get the round window button, the menu bars, or the ribbon back. (We do actually get the Nav Pane.) Using the CTRL-F1 key is ineffective.

This used to work. Now, however, it does not have the desired effect in our developer copy. What is frustrating is that it still works in a backup copy of the database front-end. I can't see any obvious settings that would lead to this condition, but then again, this is my first sojourn into the bowels of Ac2007. (We only work with what the government gives us or I would have done it sooner...)

Anyway, we have tried selecting various forms and tables. Almost anything gets us the Navigation pane but NOTHING we have tried gets us to the ribbon. Further, since the ribbon is now XML, it is a LOT harder to try to select something from it to force its visibility.

So... any suggestions?
 
When I fixed my problem regarding the way Access closed after encountering errors, I think I fixed this one, too. In retrospect, it was probably that I had a "broken" trap sequence that did a GoTo XYZ rather than a Resume XYZ from the trap code. Believe it or not, that may have fixed it. But to have predicted the effect from that particular cause? Never in a million years.
 

Users who are viewing this thread

Back
Top Bottom