• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3054
  • Last Modified:

Hide Access Window and Still Show Popup Form

I have found and adapted code that will shrink the main Access window behind my startup popup form, so that the user is not distracted by the underlying Access window. The code uses user32 library functions and ultimately uses SetWindowPos to reduce the Access window size to 5% of its full size.  When closing the startup form, code includes the user32 library ShowWindow function to maximize the Access window. It works like a charm, except that the small Access window can be seen if one moves the currently visible popup form.

I've also seen similar code that claims to HIDE the main access window while still showing the popup form. That code uses user32 library funtions and ultimately uses the user32 library function ShowWindow function with the SW_HIDE (=0) paramater. The claim is that this hides the Access window and still allows the active form to be used. An example I've seen in several places on the web is at http://access.mvps.org/access/api/api0019.htm (code by Dev Ashish), where the key claim is: "This same function can also be used to completely hide Access window and just show your form on the desktop.  Make the form popup and from it's Open Event, call the fSetAccessWindow function with SW_HIDE as the argument."

I'm using Access 2010. When I follow these suggestions to the letter, both the Access windows and the popup form disappear, and I have to run a stand-alone module, outside the code that's supposed to run in the application I'm developing, to re-show both the Access window and the pop-up form.

Did the code to HIDE the Access window work prior to Access 2010 (or prior to Access 2007)? Or was the original "solution" not a working solution at all? Or is there something else I can do?
0
Pelegrinus
Asked:
Pelegrinus
  • 3
  • 2
1 Solution
 
Dale FyeCommented:
I have not tried this in 2010, but try setting the forms Popup property to true.

If that doesn't do it alone, then also set the Modal property to true.

You should find these properties on the Other tab of the properties dialog.
0
 
PelegrinusAuthor Commented:
Thank you. I had already set the forms to popup mode, thinking that was enough. It appears that I must also set all forms both to popup and modal, as you suggested. With that, the application runs as if it were a stand-alone app.

I pass on the caution I've seen about using SetWindow SW_HIDE: If an error occurs in the code, the Access window does not reappear automatically. This is not a problem in runtime mode, because I don't want the Access window to show at any time. But it could be a problem during development. The recommended solution: in the error-trap code, include code to re-show the Access window. I'm not sure how practical that is for me at this stage of development, but I'm keeping it in mind.

Thanks again.
0
 
Dale FyeCommented:
If you don't disable shortcuts, you can always use CTRL-G to open a code window, but your users won't have this functionality, and failure to have really good error handling could leave Access open in the background with no way to close it but the Task Manager.

I've used this for a couple of simple applications, but rarely use it any more.

If you don't mind my asking, why a "B".  What could I have done differently to get an "A"?
0
 
PelegrinusAuthor Commented:
Fair question about the "grade." I thought (and think) I was being complementary and grateful with the middle grade. I think I reacted, in part, to your comment that you hadn't tested your response in Access 2010, as well as to the part of the solution that suggested using popup mode--in my question, I had said several times that I was using popup mode. But your suggestion re the modal mode was exactly what I needed, and I do appreciate your response!
0
 
PelegrinusAuthor Commented:
Yes. I'll regrade. My misunderstanding of the grading process.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now