Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Oct 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Menus and Memory Leaks (Access XP / 2002)

    The scenario is that I have a form which has a pretty complex menu (>150 sub items on it) which is created on the fly when the form is opened and the deleted from the commandbars collection when the form closes. When the users open the form enough times (about 70) the application crashes. This can be consistantly reproduced on different machines. The menu is created on the the fly as its content is dependent on who is logged on and how they open the form (eg View, edit, new etc).

    I have set up a little test harness which creates and then destroys the menu repeatedly in an IF loop. I would expect that I could create and destroy the menu thousands of times. However what we have found is that the menu can be created and then deleted about 150 times before Access crashes out.

    I have repaired/compacted and also created a new MDB and imported the objects and there is no difference. Following the crash, everything is OK and I can repeat the test with the same results.

    Does anyone know of any Access menu limitations (documented or otherwise) which would cause this?

    Thanks in advance
    Nathan

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

    Re: Menus and Memory Leaks (Access XP / 2002)

    I can't find anything about this in Google or the newsgroups, but I can reproduce the problem. I created a loop that repeatedly creates and deletes a custom toolbar with some buttons. It runs to completion without errors in Excel, but it fails after a while in Access. It must be a bug in the internal memory management in Access - the application itself didn't use an excessive amount of memory.

    Would it be feasible to create the menu once (but hidden) when the database is opened, with all controls you need, then show and hide the items depending on the situation?

  3. #3
    New Lounger
    Join Date
    Oct 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Menus and Memory Leaks (Access XP / 2002)

    Yes, just creating the menu once would be the best option, and one we will probably go with long term.

    Thanks
    Nathan

Posting Permissions

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