How does one make the Access window invisible? I.e., I want to open a DB with initial form making it appear like a popup. The form has a "Close" button with an OnClick event that will "Quit".
How does one make the Access window invisible? I.e., I want to open a DB with initial form making it appear like a popup. The form has a "Close" button with an OnClick event that will "Quit".
With code. Has been discussed many times. Have you searched?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes. The approach where one opens a DB with POPUP form as primary via a shortcut whose size property is set to Minimized works fine. However, when running the shortcut from Shell code, one only gets an open Windows Explorer.
Code:Private Sub lblPCHelp_Click() Dim strShell As String Dim ShellRet As Variant strShell = "c:\Windows\Explorer.exe " & "c:\eRep\PerCapHelp.mde - Shortcut" 'ShortCut will open with ACCESS window minimized ShellRet = Shell(strShell, 3) End Sub
Your suggestion worked well in minimizing the app's Access window while leaving the popup form visible and positioned as desired.
As an addition to this issue, using the DoCmd.MoveSize to position the ACCESS Window of a companion app doesn't work. It seems everything I find via Google searches regarding the ACCESS Window end up taking about resizing "forms" within the ACCESS Window. For example, if I run the command "DoCmd.MoveSize 0, 0" to position the ACCESS Window to the upper left corner of my monitor it has no effect.
I have to be missing something pretty fundamental here?
Which code event are you using?Your suggestion worked well in minimizing the app's Access window while leaving the popup form visible and positioned as desired.
As an addition to this issue, using the DoCmd.MoveSize to position the ACCESS Window of a companion app doesn't work. It seems everything I find via Google searches regarding the ACCESS Window end up taking about resizing "forms" within the ACCESS Window. For example, if I run the command "DoCmd.MoveSize 0, 0" to position the ACCESS Window to the upper left corner of my monitor it has no effect.
I have to be missing something pretty fundamental here?
Try putting the code DoCmd.MoveSize 0, 0 in your Form_Load event.
That moves it to the top left for me
The full syntax is DoCmd.MoveSize([Right], [Down], [Width], [Height]) where the units are in TWIPS
DoCmd.MoveSize 10000, 5000 roughly places a form in my centre screen
I want to size and position the ACCESS Window itself, NOT the forms within it.
Ah I see - never tried to do that.
This link MAY give you an idea or two https://access-programmers.co.uk/for...d.php?t=184529
I think you will have problems getting your approach to work if your application is to be used on different size / resolution screens
As might be expected with the issue posted here, manipulation of forms, size & position, within the Access Window are fairly easy to accomplish given native Access facilities. However, it's a different story when one wants and or needs to manipulate the Access Window itself with respect to Windows. I found and employed a class module containing several uses of API's to deal effectively with the current issue. One can find reference to the class module here.
I did make one change to one of Peter's subs so that the Access Window became the default. Other than that I used his module as is. Below is the current implementation that awaits a programed treatment of monitor screen values so as to eliminate hard-coded numbers one sees in the code.
Cheers,
Bill
Code:Private Sub cmdPCHELP_Click() '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* ' The Per Capita HELP scenario is an independent ACCESS DB that opens with ' minimized ACCESS window and visible popup form positioned at an "X" (XMove)value ' defnined in the DB's global class module. ' ' We do two things here: 1) is to resize the current ACCESS window to provide space ' for the PC HELP scenario using the "Window Position" API via Peter's Software class ' module where his xg_SizeFormWindow has its default form definition statement modified ' thus hWndSize = xg_GetAccesshWnd to redefine the default to the current ACCESS window. ' And 2) launch the HELP scenario DB app itself. '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* Dim Dummy As Form ' Dummy argument to allow ag_SizeFormWindow's default action Dim strShell As String Dim ShellRet As Variant Call xg_SizeFormWindow(Dummy, 0, 0, 1325, 1025) 'Make room for scenario help adjacent to PC Preview strShell = "c:\Windows\Explorer.exe " & "c:\eRep\PerCapHelp.mde" ShellRet = Shell(strShell, 3) End Sub
After you posted, I thought about this properly.
I got sidetracked by you asking for code to place an Access app in a set location on screen & with a set size
Are you aware that what you wanted needs NO CODE
Open an Access app, reduce its size to a convenient value and move it anywhere you like on the screen
In fact you can move it onto a second monitor if you have one.
Close it & reopen – exactly the same size & place
QED
I haven't looked at the code from Peter's Software properly this time around though I have in the past.
I imagine all it does is allow you to save any settings you choose for repeated use
Thanks to ridders52 I obtained the class module containing the screen/monitor metrics code. With that, I cleared up the mystery regarding the hard-coded values one sees in the statement "Call xg_SizeFormWindow(Dummy, 0, 0, 1325, 1025)" where those values were obtained empirically. On closer examination of the xg_SizeFormWindow Sub, I found that the parameter values for the screen coordinates are in pixels not twips as originally belived. It turns out that my monitor happens to be 15 Pixels/Twip so the values 1325 and 1025 now make sense when conversion is done to inches with 1440 Twips/inch.
Thanks again to our friend on the "other side of the pond".
Yes, I'm aware of the point made. The current app's Access Window size and position is dictated by the companion app that appears beside it. As such, the current app has been made known where the companion's Access Window is positioned on the screen and needs to adjust its position accordingly.Are you aware that what you wanted needs NO CODE
Open an Access app, reduce its size to a convenient value and move it anywhere you like on the screen
In fact you can move it onto a second monitor if you have one.
Close it & reopen – exactly the same size & place
QED
Thanks again for the metrics code,
Bill