Results 1 to 13 of 13
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Access Window invisible

    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".

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    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.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    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

  4. #4
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,205
    See if my example database helps https://www.accessforums.net/showthread.php?t=69856
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    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?

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,205
    Quote Originally Posted by GraeagleBill View Post
    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?
    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

    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    I want to size and position the ACCESS Window itself, NOT the forms within it.

  8. #8
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,205
    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
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    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

  10. #10
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,205
    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
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  11. #11
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    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".

  12. #12
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,205
    You're welcome
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  13. #13
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    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
    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.

    Thanks again for the metrics code,
    Bill

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 01-08-2018, 09:37 AM
  2. Replies: 10
    Last Post: 12-05-2017, 01:14 AM
  3. Replies: 5
    Last Post: 10-29-2017, 06:46 AM
  4. My debugging buttons are all invisible in my ACCESS
    By johnseito in forum Programming
    Replies: 1
    Last Post: 09-29-2017, 10:45 PM
  5. Replies: 3
    Last Post: 10-23-2013, 08:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums