Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Slow Closing Form (2000)

    I have a form that encompasses a list view that is taking a silly amount of time to close. It is running no code on exit it is simply closing. When debugging and stepping through the form closes immediately, however when closed in runtime there is a delay! Anybody had a simmilar problem?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow Closing Form (2000)

    I don't have a specific suggestion, but a general one. Make sure that the Name AutoCorrect options in the General tab of Tools | Options are off; Name AutoCorrect can cause forms to be sluggish. It is a per-database setting, you'll have to do this once for each database.

  3. #3
    New Lounger
    Join Date
    Jul 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow Closing Form (2000)

    thanks hansV. No joy though

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow Closing Form (2000)

    <P ID="edit" class=small>(Edited by charlotte on 21-Oct-03 16:13. to activate link)</P>You can check the following link for possible perforance issues:

    http://www.granite.ab.ca/access/performancefaq.htm

    HTH

    John

  5. #5
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Slow Closing Form (2000)

    I don't know if this will be any help, in one db I had some forms that were very slow to close (especially when using network connection for linked tables) even though they had no code that executed on closing. For unrelated reasons, I replaced the standard VBA code used to close form (DoCmd.Close) with the Windows PostMessage API function as shown in this example:

    API declaration (place in standard code module):

    Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
    (ByVal hwnd As Long, ByVal wMsg As Long, _
    ByVal wParam As Long, ByVal lParam As Any) As Long

    ' Windows Message (WM) Constants:
    Public Const WM_CLOSE = &H10

    Event procedure for "Exit form" button:

    Private Sub Exit_button_Click()
    PostMessage Me.hwnd, WM_CLOSE, 0&, 0&
    End Sub

    When I used the above sub in place of DoCmd.Close command, the slow-closing forms closed without delay. By using the API, you post a message to the form window's message queue directly, telling it to close. The VBA command essentially does the same thing, but for some reason the "slow" forms would not close immediately. You can try this, but no guarantee will work in your case. The other thing to check is, even if you do not have a Form Close or Unload event, is any validation procedure, such as a BeforeUpdate event, which may be slowing things down when closing form if an edited record was not explicitly saved.

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •