473,395 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

acCmdAppMinimize causes form to lose focus on accde file

63
I have an application that minimizes the Access application window and displays a pop-up modal form.

The Application window is minimized with this command in the form's Load event.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdAppMinimize
When opening the file, the form/application retains focus and appears on top after the application window minimizes. But when I save it as an ACCDE file and open that, the form/application loses focus. If there are any other programs open, the form is hidden behind them all.

The only workaround I've found is to not use the above command, but instead to create a shortcut to the ACCDE file and in the Shortcut properties, set the "Run" property to "Minimized".

I'd like to find a solution within Access, if possible, because it's not always feasible to use the Shortcut workaround.

Any ideas would be much appreciated. Thanks!
May 20 '09 #1
6 5545
MMcCarthy
14,534 Expert Mod 8TB
Try this and see if it makes any difference

Expand|Select|Wrap|Line Numbers
  1. Application.DoCmd.Minimize
May 22 '09 #2
ADezii
8,834 Expert 8TB
@postman
You could always use the olde API to make sure the Application Window is Minized. It would only require a Function Declaration and the passing of the Application Handle (Application.hWndAccessApp) to the appropriate API Function.
May 23 '09 #3
postman
63
@msquared
I tried it, but this code minimizes the form, not the application window.
May 27 '09 #4
FishVal
2,653 Expert 2GB
http://support.microsoft.com/kb/186431

And since form's hWnd is available via Form.Hwnd property you may drop FindWindow() function and use only BringWindowToTop().

Didn't test it but looks like it will work.

Regards,
Fish
May 27 '09 #5
postman
63
@ADezii
Thank you. That helped. Here is the API function I used at the top of the form's code module:

Expand|Select|Wrap|Line Numbers
  1. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
  2.      ByVal nCmdShow As Long) As Long
Then in the Form's Load event, I put this line:
Expand|Select|Wrap|Line Numbers
  1. 'Minimize application.  "2" = minimized
  2. Call ShowWindow(Application.hWndAccessApp, 2)
Thanks for the help!

P.S. - I'm new to API calls. Are they pretty standard across the various iterations of Windows, or do they change? For example, would this call work on XP, but not on Vista or Windows 7?
May 27 '09 #6
ADezii
8,834 Expert 8TB
@postman
To the best of my knowledge, they are fairly standardized across Windows Platforms except when dealing with earlier Versions. You must be extremely careful when calling them since there is no Buffering involved as with higher level Function Calls. They can crash Applications and even Lock Up the OS. I am referring to making sure you pass the proper number of Parameters, the Parameters are of the proper Data Types, some API Functions return results with Terminating Nulls, etc. Just research them as much as possible before you use them, and always work on a Copy of the Database at first.
May 27 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mica Cooper | last post by:
Hi, I have a series of Select menus on a page. I am trying to allow the user to click on the Select title and have it popup a help window. This works fine with the following code except that all...
6
by: Ekim | last post by:
hy, I've got a quite simple application: one windows form that consists of a button, and as soon as the user hits the button a second form shall appear. The difficult thing about it is that I...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
6
by: =?Utf-8?B?U2NvdHQgTGFt?= | last post by:
Hi, I have a VB.NET form with a bunch of controls in it . The focus is in one of the controls , (i.e. a textbox), is there any way to click on the form itself and make the textbox lose focus and...
15
missinglinq
by: missinglinq | last post by:
I'd like to use acCmdAppMinimize with two forms on the screen at once. Currently, if I have a form opening the db (with DoCmd.Maximize in the OnLoad event) and then a popup form on top of the first...
4
patjones
by: patjones | last post by:
Hi everyone: I have a form in my database called "frmChecks". In the properties for this form, I set On Load to , which points to some code in VB that maximizes the form window and sets a...
4
by: SpaceMarine | last post by:
hello, i am having a problem creating a .ACCDE file from an Access 2007 .ACCDB file. its somewhat large application, about 80 megs. it was originally an Access 2000 app that somebody else...
4
by: MrDeej | last post by:
Anybody now if i can do this programtically? My challenge is that i have a maybe 10 distributions a week with updates and changes which i now have found the accde format to be of good use. I also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.