Solved

Toolbars and menu bar not visable after restore

Posted on 2009-07-11
21
729 Views
Last Modified: 2013-11-27
Hi,

I'm using the:

ShowWindow Application.hWndAccessApp, SW_HIDE

To hide the MS access window when my splash screen loads and the login page loads.

Then after the user has logged in correctly:

ShowWindow Application.hWndAccessApp, SW_NORMAL

When access restores all the Access "Menu Bar" and Default Toolbar is gone as well as the Database
window's Toolbar (Open, Design, New, Delete(X) and Views)

I know some of these i have already turned off, but i do have a configured ribbon which usually loads at startup.  How can i get access to restore and show the menu bar?

Regards,
0
Comment
Question by:d10u4v
  • 8
  • 6
  • 4
  • +1
21 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24832139
This is why many developers do not use this "Hide The Access Application" technique.

Techniques like this have there place, but thers are so many different ways this can be done that depend on many different Factors.

Besides, AFAIK, most of the code to do this was written to work with Access 2003 and older, under Windows 2000 and Older.
Access 2007 (Windows XP, Vista) is a whole new ballgame with regards to what you can and cannot do with the User Interface.

I am sure a solution for this is available, (or some other code) but Access 2007 provides so much functionality that allows developers to control the way their application looks and works, that these "Hide Access" techniques are really not needed. (IMHO)

Expert LSMConculting offers the best advice on things like this:
(Paraphrased)
   "If you want to go through all the trouble of doing this in Access, you may as well write the Application in a .net or other Language where this is easy to do."

Just my 2c

;-)

JeffCoachman
0
 
LVL 84
ID: 24832363
Excellent advice ;)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24832541
I always give credit where credit is due...

(Now if I could have only spelled you UserName correctly...
  "LSMConculting"?

That's why I usually stick with "LSM"
Jeeze ...it took me about a year to stop saying "LMS"

;-)

Jeff
0
 

Author Comment

by:d10u4v
ID: 24927498
Hi,

What is the MS Access 2007 equivalent to the old 'Hide Access'?  I have been searching all over and haven't come across anything.

Tom
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24927958
<old 'Hide Access'?>
?
Can you be a bit more specific?

If you are talking about hiding the database window, then in Access 2007 it is hiding the Navigation Pane.
Pressing the F11 Function key will Toggle this setting.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 25107750
<Not really answered and it appears that there will be no answer.>

Can't really provide an answer if yoy never clarified the question.

I asked
<Can you be a bit more specific?>

You replied:
?

<it appears that there will be no answer>
Perhaps there is, are you still interested?
Again, because you never replied to my last post for clarification, there is not much I can suggest.

Is there a reason why you totally ignored my last post and refused to reply?

JeffCoachman
0
 

Author Comment

by:d10u4v
ID: 25108129
Never clarified the question!  I think my original question clearly states what I'm trying to achieve.  The initial answer recieved was that 2007 does not use this method.  After comments unrelated to the question, I asked what is the 2007 equivalent to the hide access window.  No answer received.  In you initial post you comment that you believe there is code in 2007 to do this.  My last post was asking for more info on this 2007 technique.

I'm sorry if you thought I totally ignored your question, I was just a little confused to the reason why you posted it.
0
 
LVL 84
ID: 25108679
Generally you shouldn't request a Delete unless you've answered all Expert commnets. I too found your question a bit vague, since you could be referring to several different things in regards to Access (i.e. hide the Database Window, hide the Access "shell", etc etc). Your follow up reference to the "old 'Hide Access'" was equally vague, and could have meant several different things.

You can of course choose not to respond to Expert comments, but that's not going to sit well with most of them.
0
 

Author Comment

by:d10u4v
ID: 25108859
Please do show me where my initial question is not clear?  Also the first answer does mention that what i was asking can be done in ms access 2007 but then doesn't discuss this method. Strange.  Saying I should write my programme in a different language is neither here nor there.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:d10u4v
ID: 25109703
Can I refer you to my original post and can you please advise me as to the areas which need clarifying.

Regards
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 25109972
<ShowWindow Application.hWndAccessApp, SW_HIDE>
Using it where?
Using it how?

<the MS access window>
The "Access Application?
The "Navigation Pane"?
The "Main Screen/Form" in Access?
There is no Generic "MS access window"
Again, this means different things to different people, so you need to be very specific here.
Please post a screenshot of the *Exact* window you are referring to.

<Then after the user has logged in correctly:
ShowWindow Application.hWndAccessApp, SW_NORMAL>
Again, ...Where, How?

There is no way that anyone can troubleshoot an issue like this by just seeing two random snippets of code.
Can we at least agree on that?

<When access restores all the Access "Menu Bar" and Default Toolbar is gone as well as the Database
window's Toolbar (Open, Design, New, Delete(X) and Views) >
MenuBars and ToolBars do not exist in Access 2007 in the same way they did in Access 2003 and older, again please post a screenshot clearly indicating what graphic elements you are referring to.

<i do have a configured ribbon which usually loads at startup.>
"Usually"?
Besides not knowing what this means, ...I really can't even guess at it's relevance to the issue at hand.


<Can I refer you to my original post and can you please advise me as to the areas which need clarifying.>
Have you read our posts?
For the third time, what is: "old 'Hide Access'?"
Nobody knows what you mean by this, again, ....please clarify, with a screenshot, code, or a sample database.

This "Hide the Access Application Window", technique (if this is in fact what you are referring to)
Was most used in Access 2003 and older and in Widows 2000 and older.
Since that time there have been fundamental changes in the way "Windows" (XP, Vista, Window 7,,...etc,) deals with the visibility of Programs (Areon Interface, Transparency, ...etc).
Also the new "2007" style interface also makes several changes to the way you manipulate screens/windows.

FWIW, I personally have not seen a technique to do this in Access 2007, in any version of Windows.
(Perhaps LSMConsulting has more insight)
But, again, you can do your own search to be sure.
Here is a popular link:
http://www.mvps.org/access/api/api0019.htm

Again, FWIW the new Office 2007 interface offers many options regarding how an Access application can be presented to the user.
I suggest you look into using this new interface to simulate the effect you desire, and not try to use "Old" techniques, that may not even work anymore.

JeffCoachman
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 25110026
<FWIW, I personally have not seen a technique to do this in Access 2007, in any version of Windows.>

Nor have I seen anything regarding this for 2007. And of course you're right about the major changes in the Access infrastructure.

Bottom line: If you code, which worked in 2003, does NOT work in 2007 then you're pretty much out of luck. This was always a major league kludge anyway, and many people had significant troubles with that technique (that is, if you mean hiding the Access application window).

I realize that doesn't really help much, but unfortunately it's the correct answer.


0
 

Author Comment

by:d10u4v
ID: 25110470
<ShowWindow Application.hWndAccessApp, SW_HIDE>
<<Using it where?
It is used in a module which is called from an Autoexe macro which runs as soon as the programme is opened
<<Using it how?
What do you mean how?  I currently use it in the following format within the module
ShowWindow Application.hWndAccessApp, SW_HIDE

This hides the Ms Access Window.

<the MS access window>
The "Access Application?
The "Navigation Pane"?
The "Main Screen/Form" in Access?
There is no Generic "MS access window"
Again, this means different things to different people, so you need to be very specific here.
Please post a screenshot of the *Exact* window you are referring to.

I don't know what else i can say.  Even Microsoft use the term "Microsoft Access Window" when discussing the same code.  The Access Application is not, as Microsoft state, the window in which MS Access runs.   The Navigation Pane is the Navigation pane.  It is not a seperate form or screen.  All i have ever known it to be known as is the Ms Access Window.

<Then after the user has logged in correctly:
<ShowWindow Application.hWndAccessApp, SW_NORMAL>
<<<Again, ...Where, How?
Where:
After looking at my code, this actually runs after the Splash screen has completed all its checks (check that the SQL database is connected, the tables are linked correctly, all the relevant Dll's are registered, references are present and a valid ini file is present in the programme directory).  The the MS Access window is made visable again (SW_NORMAL) and the user is offered the Log in screen.  The user logs in by selecting to use Windows Authentication or to enter a user name and password.

This is where my problem occurs, nothing is loaded.  The window us empty,except for the minimise, maximise and close buttons in the top RH corner.  

<i do have a configured ribbon which usually loads at startup.>
"Usually"?
<<Besides not knowing what this means, ...I really can't even guess at it's relevance to the issue at hand.

In 2007 a new feature, which is a major addition to the 2007 suite of products, Microsoft introduced the Ribbon which holds all the menu options and features of the program the user is working in.  This Is like a tool bar.  Instead of using the standard Ribbon which is available in MS Access i have written and created my own ribbon which is coded to be used in place of the standard Access Ribbon.  Usually (when not using the SHOW and HIDE codes above) this is loaded when the user logs in, however when i added the two lines of code (above) the ribbon does not load.


The bottom line is that i don't want the MS Access Window (call it what you will) to load in full view when a user runs the program.  I would like my splash screen to open first, minus any other window, and after this splash screen has completed its necessary checks, activate the MS Access window and show the Login Screen.  Currently even if i add code to my spalsh screen after the (ShowWindow Application.hWndAccessApp, SW_NORMAL) line to show Ribbon it still will not show.

Tom

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 25112325
LSMConsulting quote:
<Bottom line: If you code, which worked in 2003, does NOT work in 2007 then you're pretty much out of luck. This was always a major league kludge anyway, and many people had significant troubles with that technique (that is, if you mean hiding the Access application window).
I realize that doesn't really help much, but unfortunately it's the correct answer.>

I agree.

JeffCoachmam
0
 
LVL 84
ID: 25112671
I think we're all aware of what the ribbon is.

If you experience odd behavior after using these methods, then there's little that can be done. Most professional developers don't use these methods so there's not much written about them, and even less dealing with Access 2007 (and the little I've read indicates that behavior is NOT the same in 07 as it was in earlier versions).

However, we may be getting somewhere.

If it's just your Ribbons and such that aren't loading, there are codes and methods available to show those. Can you show the code you're using to show your Ribbons?
0
 

Author Comment

by:d10u4v
ID: 25117121
Then why...

<i do have a configured ribbon which usually loads at startup.>
"Usually"?
Besides not knowing what this means, ...I really can't even guess at it's relevance to the issue at hand.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 25117874
You cannot close a question when you have been given a valid solution.

In this case from LSMconsulting:
<"Nor have I seen anything regarding this for 2007. And of course you're right about the major changes in the Access infrastructure.
Bottom line: If you code, which worked in 2003, does NOT work in 2007 then you're pretty much out of luck. This was always a major league kludge anyway, and many people had significant troubles with that technique (that is, if you mean hiding the Access application window).
I realize that doesn't really help much, but unfortunately it's the correct answer.>

So in this case, his post should be accepted.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 25141272
d10u4v,

This question (hiding the application window in Access 2007) has come up a few times at EE (and elsewhere), and the responses are generally the same and are consistent with the bulk of the information I have seen about this around the web. This technique does not behave the same way in Access 2007 as it has in previous versions, and it has had it's fair share of problems in previous versions as well.

It is not a technique that I have used myself, but I have played around with it a bit. This sample hides and restores the application window in Access 2007, and the Ribbon, etc DO show up when the window is restored. This is is dependant on the following properties of the main menu, which is left open:
- Modal = YES
- Dialog = YES

Without these settings, the navigation panel, ribbons, etc are completely missing when the application window restores.

I also had to make a major compromise in using an input box instead of a form to trigger the restore of the application window. The form in my Access 2007 sample simply does not show up when the application window is minimized. An inputbox, however does visibly popup and can accept user input to restore the application window. My understanding is that a regular popup/modal form does show up in earlier versions of Access when the window is restored (so this is a major difference).

You can look into this sample and see how it compares to your own application.

I'm also interested in digging into this one a bit more if you post more details. This method seems very dependent on form properties and code beyond the showWindow calls that you have posted. If you can upload a sample that illustrates your specific issue, I'll take a look at it.
Useful details to post:
- Form properties
- Actual forms being opened and sequence of events
- Complete code from your splash form (to show when/how you are minimizing the application window, and how the opening/closing of your various forms fits in)


My gut feeling, however is the same as the others' in that this will not work in Access 2007 without some major compromises. And even at that point, it will be a shaky solution, dependant on the environment it is run in.

Remove the .txt extension on the .accdb file when you download it. If you have an .accdb sample to upload yourself, add a .txt extenstion so that EE will allow the upload.

The password needed to restore the application window in this sample is "admin".


EEHideAppWindow.accdb.txt
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 25145252
Miriam, I usually append ".mdb" to the file...

So YourDatabase.accdb, will become YourDatabase.accdb.mdb
FWIW
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now