Page 1 of 4 1234 LastLast
Results 1 to 15 of 47
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Minimize the Access Window

    I have a simple module that runs a function that issues a Msgbox Yes/No to its users. (fires periodically via Windows Scheduled Task.) Is there any way to prevent the Access window from opening maximized? I do have a Docmd.minimize in the general module function, but that doesn't affect the Access window.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Check with Isladogs (mendip data systems IIRC) as I think he's the go to guy around here for hiding the application window. I'm thinking using an application level message function might be your downfall here. Perhaps use a modal form instead of a message box? If it wasn't for the fact that it has been an hour since you posted and don't have a definitive answer yet I wouldn't have posted because that's probably not a whole lot of help.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Perhaps use a modal form instead of a message box?
    Yes, my thought as well. And yes again, Colin usually has some thoughts on these kinds of issues. Albert does too, but I haven't "seen" him post in ages.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Albert D. Kallal (or some similar spelling)? A fellow Canuk I think. Cannot ever recall him posting here. You must be referring to someone else.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I do mean Albert D. Kallal and now that you mention it, I think help I received from Albert was back before the forum got rolling. And yes, Albert is up in Vancouver Canada the last I knew.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Have a look at this article and example app Control Application Interface - Mendip Data Systems.
    You may need to replace the message box with your own custom form for this purpose.
    Get back to me if you have any questions.

    Another possible solution could be to show a system tray alert instead of a message box. See the balloon tooltip alert example in Attention Seek - Mendip Data Systems.
    However that type of alert doesn't allow user interaction if Windows 7 or later.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks Colin, Micron thought that
    your own custom form for this purpose
    might also be the solution. I will indeed study the CAI link you posted and post back the final results.
    Thanks again,
    Bill

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Just tested. A custom form isn't needed
    A standard message box will display perfectly 'floating on the desktop' with the Access application interface hidden

    Click image for larger version. 

Name:	Capture.jpg 
Views:	40 
Size:	101.4 KB 
ID:	45120
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks Colin, WORKS GREAT! I'd already created a custom form and modified the code accordingly, which is a bit more user friendly so I'll stay with it.

    I have another app where I'll use the modDatabaseWindow API's to help enhance the App's UI. BTW, I'm still experimenting with the API's and it appears that ALL forms need to be POPUP. Is that correct?

    Thanks again,
    Bill

  11. #11
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Hi Bill
    Yes. The forms need to be popups so they appear independently of the (hidden) application interface.
    Standard forms form part of the interface so would be hidden as well.

    Reports are a bit trickier to handle in this situation. The example app shows several different approaches for handling reports.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Yes. The forms need to be popups
    Thanks, I thought as much.

    example app shows several different approaches for handling reports
    Thanks for the heads-up about reports. The second app I have where I'm going to apply the ModDatabaseWindow API's has a report, so the example will be most helpful. (I'll post back when I've dealt with that.)

    Thanks again,
    Bill

  13. #13
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You're welcome. As mentioned, there are several ways of handling reports with this type of app.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #14
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I'm in the midst of studying the sample report's code module to determine what I need to adopt from it. I just need to gain more understanding of the toggling of the ribbon and the conditions under which it opens the host form. The latter a bit confusing in that it's the form that opens the report.

    Ever onward,
    Bill

  15. #15
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Colin,
    I'm making progress with report, but I'm not quite there yet and can't get the report to display. Two sections of code below: the first is the opening code from frmPrintOptions where the user selects the "Preview" option. The second is the report's code module, where I've attempted to adapt your code to my report, I even captured your "print command button". Anyway, all I get is the report title bar located at 0,0, as shown in the screenshot.

    Code:
    Private Sub cmdPreview_Click()
    '=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '
    '=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    
    Me.Visible = False
    
    On Error GoTo Err_Handler
    
         'hide form & open report in report view
        DoCmd.Minimize
        DoCmd.OpenReport "rptDirectory", acViewReport, , , acDialog, "RV"
        DoCmd.Close acForm, "frmprintoptions"
        
    Exit_Handler:
        Exit Sub
    
    Err_Handler:
        strProc = "cmdReportView_Click"
        MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
        Resume Exit_Handler
    
    End Sub
    Code:
    Option Compare Database
    Option Explicit
    Dim strAppendage As String
    Dim strProc As String
    
    Private Sub Report_Open(Cancel As Integer)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '  strRptSort is a global variable that is set by frmRegistry and frmPrintOptions
    '  depending on conditions chosen by the user.  The OPEN code here simply adjusts
    '  the report title section in keeping with and the setting of the sort order.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    On Error GoTo Err_Handler
    
        Select Case Me.OpenArgs
        
        Case "RV" 'acViewReport
            DoCmd.Restore
        Case Else 'acViewPreview
            DoCmd.Maximize
        End Select
        
    Me.lblHeader.Caption = strRptTitle
    
    Select Case strRptSort
        Case "lblLastName"
            strAppendage = "Last Name"
            Me.OrderBy = "LastName"
        
        Case "lblFirstName"
            strAppendage = "First Name"
            Me.OrderBy = "FirstName"
        
        Case "lblUnit"
            strAppendage = "Apartment numbers"
            Me.OrderBy = "Unit"
        
        Case "lblExt"
            strAppendage = "Telephone Extensions"
        
        Case "lblCell"
            strAppendage = "Cell numbers"
            Me.OrderBy = "Cell"
        
        Case "lblLandLine"
            strAppendage = "Landline numbers"
            Me.OrderBy = "Landline"
        
        Case "lblEMA"
            strAppendage = "Email Addresses"
            Me.OrderBy = "EMA"
    End Select
    
    Me.RecordSource = strRptRecSrc
    Me.Filter = strRptFilter
    Me.FilterOn = True
    
    Me.OrderByOn = True
    Me.lblSortedBy.Caption = "Listing Sorted by " & strAppendage
    
    Exit_Handler:
        Exit Sub
    
    Err_Handler:
        strProc = "Report_Open"
        MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
        Resume Exit_Handler
    
    End Sub
    
    Private Sub Report_Load()
    On Error GoTo Err_Handler
        
        'Show & maximize ribbon
        ShowRibbon
        If IsRibbonMinimized = True Then ToggleRibbonState
        ShowRibbon
        
    
    Exit_Handler:
        Exit Sub
    
    Err_Handler:
        strProc = "Report_Load"
        MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
        Resume Exit_Handler
    End Sub
    
    Private Sub cmdPrint_Click()
    On Error GoTo Err_Handler
    
        Me.lblHeader.Width = 11670   'Restore header width to 8.1042 inches
        DoCmd.PrintOut
        
    Exit_Handler:
        Exit Sub
    
    Err_Handler:
        strProc = "cmdPrint_Click"
        If Err <> 2501 Then 'err 2501 - user cancelled printing
            MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
        End If
        Resume Exit_Handler
    End Sub
    Click image for larger version. 

Name:	000.jpg 
Views:	23 
Size:	11.0 KB 
ID:	45130

    What am I missing?

Page 1 of 4 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 12-05-2017, 01:14 AM
  2. Replies: 5
    Last Post: 10-29-2017, 06:46 AM
  3. Replies: 10
    Last Post: 05-26-2017, 02:38 AM
  4. Minimize form If access Window is restored
    By Lukael in forum Programming
    Replies: 2
    Last Post: 04-02-2016, 10:25 AM
  5. Minimize access window problem
    By McHammer in forum Forms
    Replies: 2
    Last Post: 04-24-2010, 05:14 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