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. - 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!
6 5580 MMcCarthy 14,534
Recognized Expert Moderator MVP
Try this and see if it makes any difference - Application.DoCmd.Minimize
ADezii 8,834
Recognized Expert Expert @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.hW ndAccessApp) to the appropriate API Function.
@msquared
I tried it, but this code minimizes the form, not the application window.
FishVal 2,653
Recognized Expert Specialist 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 BringWindowToTo p().
Didn't test it but looks like it will work.
Regards,
Fish
@ADezii
Thank you. That helped. Here is the API function I used at the top of the form's code module: - Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
-
ByVal nCmdShow As Long) As Long
Then in the Form's Load event, I put this line: - 'Minimize application. "2" = minimized
-
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?
ADezii 8,834
Recognized Expert Expert @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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 the Select choices are lost.
<A
HREF="javascript:location='menu.jsp';window.open('menuhelp.jsp?menuID=5','me
nuhelp',)">MenuTitle</A>
I saw an example of a popup on a website that did not lose the menu choices.
|
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 want the new form to be created as
"deactivated" - that means that the second form has an editbox in it, and
this must NOT have the focus - instead, the calling form shall keep its
focus.
One simple way would be to immediately set focus back...
|
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 appears that the data goes straight to the
processing page, rather than the javascript seeing if data is missing and
popping up an alert. I thought it may be because much of the form is
populated with data from the db (lists, etc.), but when I leave...
|
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 have the form
gain the focus ,
so that no control on the form has the focus ?
Thanks,
Hang
|
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 form, the first form vanishes when the second form appears.
Alternatively, I like to have both showing with just the Access container showing, with no native menus showing. Unchecking everything in Startup gets rid of everythinh except File - Edit...
| |
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 background color gradient for the form.
Everything works fine when I open the database and start the form in .accdb mode. However, when I convert the database to .accde mode and open it, I get an error that says "The expression On Load you entered as...
|
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 wrote for our user base, which ran
it as a .MDE. i have now converted it Access 2007 .accdb, and am to
use the "Make ACCDE" function off the Database Tools ribbon bar.
|
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 want to force our developers to change the title, write version history and so before we make the accde file and all that i can manage if we can get VBA to make the ACCDE file instead of pushing the button in Access
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |