Results 1 to 3 of 3
  1. #1
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133

    After adding module, queries and reports no longer appear. SoS

    Hey everyone so we added a module to our db to hide the access window in the background, set all the forms to modal and popup so everything runs correctly on the front end here is the module.



    Code:
    Option Compare Database
    Option Explicit
     
    Global Const SW_HIDE = 0
    Global Const SW_SHOWNORMAL = 1
    Global Const SW_SHOWMINIMIZED = 2
    Global Const SW_SHOWMAXIMIZED = 3
     
    Private Declare Function apiShowWindow Lib "user32" _
    Alias "ShowWindow" (ByVal hWnd As Long, _
    ByVal nCmdShow As Long) As Long
    Function fSetAccessWindow(nCmdShow As Long)
         
        Dim loX As Long
        Dim loForm As Form
        On Error Resume Next
        Set loForm = Screen.ActiveForm
         
        If Err <> 0 Then
            loX = apiShowWindow(hWndAccessApp, nCmdShow)
            Err.Clear
        End If
         
        If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
            MsgBox "Cannot minimize Access with " _
            & (loForm.Caption + " ") _
            & "form on screen"
        ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
            MsgBox "Cannot hide Access with " _
            & (loForm.Caption + " ") _
            & "form on screen"
        Else
            loX = apiShowWindow(hWndAccessApp, nCmdShow)
        End If
        fSetAccessWindow = (loX <> 0)
    End Function
    Everything was working fine so we created the ACCDE for the front end users on the network drive.
    We discovered we cannot load reports with the ACCDE application but everything else works fine, when I show the menus and data and attempt to open the query or report I receive an error that just displays "Unknown" but they still open in design view. any suggestions?
    Attached Thumbnails Attached Thumbnails sdfgsdfgd.PNG  
    Last edited by Forbes; 03-30-2017 at 01:42 PM. Reason: CoC

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    the accde version ,there should be no reason to hide everything. Users can't access them anyway.
    Can you still see them in the accdb? If so, just make the accde without hiding.
    Last edited by ranman256; 03-31-2017 at 04:18 AM.

  3. #3
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    So here is how I solved the problem, and Ranman I appreciate the advice, I did not get around to giving it a try however and with what this reporting system is for, it could be potentially harmful to a persons feelings/ work ethic as this report is to condition employees, this would be bad if the employees were seeing what and who was reporting them and why.

    We had a few issues to solve when hiding the Access windows, essentially the major fix was to add:
    Code:
    DoCmd.Maximize
    on open

    and changed from report view to print preview. Then deleted the ACCDE and removed menus right clicking and finally changed the on open to re hide the window and before closing and reopening we created the ACCDE so it carried over the minimize properties on open and tested it on our WAN and it all works wonderfully the form opens by itself now on the front end and closes the entire program once the record is submitted. very minimal for users running quickly set to backup regularly and easy for managers to see full monthly reports (or of a time frame of there choosing). Thank you for the help!

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

Similar Threads

  1. Adding photos to reports
    By chr1stoper1 in forum Reports
    Replies: 16
    Last Post: 09-22-2016, 01:40 PM
  2. Replies: 1
    Last Post: 04-26-2016, 05:24 PM
  3. Adding new reports to an existing report
    By Rick_S in forum Access
    Replies: 33
    Last Post: 01-30-2016, 04:54 AM
  4. reports vs queries?
    By RLehrbass in forum Access
    Replies: 4
    Last Post: 08-03-2015, 07:22 PM
  5. Replies: 2
    Last Post: 10-31-2014, 07:42 AM

Tags for this Thread

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