Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18

    Whoa... cool. Hey Rural, that is the code and the author exactly. Seems our programmer did not take the advice to heart though

    I didn't include the name because I did not know if it was one of our employees, it is still present in the program though.

    I replaced the code in the wee hours of the night with someone else's provided to accomplish much the same task, and lo and behold... it no longer crashes in the runtime.

    I do still have an issue though, try as hard as I may... I could not get the program to hide the 'background' access window when using the minimize button. I'm sure that started this whole mess. The maximize command looks like a built in access command, and before I changed the code I mentioned, I made the minimize the same way (built in access command) and that got rid of the crash too.

    This is Windows Professional 32-bit.

    I'll post the replacement code when I get to work and where I found it, along with what I tried so far.

    Thanks for the input, since I have like 3 hours experience at the most in Access programming

    What do the Beatles say? 'I get by... with a little help... from my friends...'

    FYI, the code seems to be a bit bloated. The front end program is 32.5Mb (!), and all the user data is in the back end.

  2. #17
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Forms add up quickly, especially if they have graphics on them. That is not a particularly big FrontEnd. I don't minimize my forms but make them invisible when I want to hide them.

  3. #18
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18
    Here's the code directly linked to the buttons [Event Procedure] I tried before replacing the WindowCtrl module with new code:

    ***
    Private Sub cmdMax1_Click()
    DoCmd.Maximize
    End Sub

    Private Sub cmdMin1_Click()
    DoCmd.Minimize (was ?fSetAccessWindow(SW_SHOWMINIMIZED))
    End Sub
    ***

    This works fine, but when you minimize the main form the Access main window remains, maximized. I need them both to minimize together, and maximize together (not sure that is necessary on the maximize, it probably brings the Access main window with it without being told to). Even better, I'd like the main Access window to go away completely.

    The code you found (the same I cut and pasted), what is wrong with it? I saw the explanation about error handling, but when I replaced that code with someone else's... it worked fine without having to change anything else the program was doing with regard to error handling.

  4. #19
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm sorry but I'm off to a 4 day Conference right now. There is *nothing* wrong with Dev's code that I linked to.

  5. #20
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18
    Alright, so there is nothing wrong with the code. The programming on our side is bad, and I'm attempting to work around that in a fashion. Anyone have any suggestions as to where I should either A) look for our 'bad' code (since it debugs fine) or B) accomplish the same goal in the program by other means?

  6. #21
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Just getting back into the swing of things. WinXP, ac03 and hiding the Access main window, correct? All of the forms are set as PopUp and Modal, right?

  7. #22
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18

    Question Updated Information

    I think I may have been over-complicating things. While you were away my Father made a new database with a single form (with a single button), and a single simplified VBA module (pared down for troubleshooting).

    The following still causes a crash in the 'run-time' version of 03, yet works fine in the 'full' version of 03. Can you shed any light on this or have any suggestions that may help track down the issue?

    Much obliged, and thank you for your help so far!



    Form:
    __________________________________________
    Option Compare Database

    Private Sub Command0_Click()
    fSetAccessWindow (SW_SHOWMINIMIZED)
    End Sub
    __________________________________________



    Module:
    __________________________________________
    Option Compare Database

    Global Const SW_SHOWMINIMIZED = 2

    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

    loX = apiShowWindow(hWndAccessApp, nCmdShow)

    End

    End Function
    __________________________________________

  8. #23
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'm sorry but could you answer the questions I posed in post #21 please?

  9. #24
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18
    Sorry... of course. Windows XP, Access 2003 (the database reports it is in Access 2000 format). The answer is yes the forms are PopUp, but no they are not Modal.

    The application (in full Access) maximizes upon open, and when the minimize button (form button, not windows native) is pressed both the application and the main Access window (that is hidden by the application window) are sent to the taskbar. The taskbar button has a descriptive label and an Access icon. Upon clicking the taskbar button, the application window opens (though not maximized) and the main Access window is visible behind it (though there are no options available). You can at that point click on the maximize button in the application (form button, not windows native) and the application once again is re-sized to the screen.

    I gather the Access window being visible is due to the program originally being authored to fill a 1024x768 resolution screen. Most of the computers are at least 1280x1048 if not a 1440 or 1600 format (widescreen LCD) at this point.
    There appears to be code to re-size the window in the program, but it is not functional and I would like it to remain that way since resizing has terrible results on LCD panels (native resolution as it were).

  10. #25
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18
    Also, this weekend we discovered the cause of this issue. Interestingly the problem was in the code I posted originally, the code you traced back to the MVP authored original.

    For some reason there is an extra 'End' statement in the code I posted (and so was present in the module of the program). This extra statement causes the crash. When it is removed and the code is as Dev originally authored it, all is well minimizing in the runtime environment.

    This extra statement never produced any errors when error handling was added to the module, and the application event log in Windows (despite catching the crash) contains the same information as the error handling (error 0, which apparently means no error). It compiles without errors, and you can also step through it with no errors. This issue was simply caught by eyeball examination of the code.

  11. #26
    stateofjustin is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    18
    I do have another question though, apparently the code to run the spell check works in the full version and it only partially works in runtime.

    When you mistype a simple word (ex. this as tihs), MS Word's auto-correct steps in and fixes it automatically. When you deliberately mistype a word that is not in the simple AC list, the word remains misspelled.

    I gather that is what is supposed to happen until the 'Spell Check' button is pressed, at which point you should be offered replacement choices for each spelling error that is found. At the point you press the 'Spell Check' button though, nothing happens.

    I've done a bit of research, however the 'spell check' code seems to be correct.

    Any troubleshooting ideas?

  12. #27
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great news on the original problem. As for MS Word's auto-correct, you should start a new thread so others will feel like joining in. This thread is a little long in the tooth. Don' t forget to use the thread tool and mark this thread as Solved.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 30
    Last Post: 06-26-2011, 10:47 PM
  2. Allow Built-in Toolbars
    By DianeG in forum Access
    Replies: 0
    Last Post: 08-26-2010, 06:04 PM
  3. Get a websites source code with access
    By trb5016 in forum Programming
    Replies: 1
    Last Post: 01-08-2010, 03:23 PM
  4. Query on chart not working properly!
    By Sim_ in forum Queries
    Replies: 0
    Last Post: 10-28-2009, 09:38 AM
  5. never built a database
    By g48dd in forum Access
    Replies: 2
    Last Post: 12-08-2008, 10:21 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