Results 1 to 6 of 6
  1. #1
    pmi is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    3

    Dynamic Form and memory limit

    Hi Everybody, I'm new on this forum and I really hope someone can help me to solve this problem.

    I've built a function that open a form in Design mode, read records from a table about appointments and create a grid with textboxes representing one appointment each. On the left there are labels with hours and as column headers there are doctors names. Practically each column shows each doctor's daily appointments (it is a medical clinique).

    Every time i change the date all controls are deleted and rebuilt.
    But after three or four day I pass I get a message of memory limit.

    The question is general : Why the memory finish if I close every variable I use during the creation with the instruction:

    set frm = nothing
    set newTxt = nothing
    rst.close
    set rst = nothing

    I apologize for my english, i hope someone can answer me.



    Thanks a lot

    Alex

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you look in Help for "specifications", you'll see there's a limit on how many controls a form can have. Controls that are deleted still count, so my guess is you're hitting that limit. Would having fixed controls and filling them in work for you?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    It is probably a memory leak. I think this was a problem in Access 2000. If you are using Access 2000 you may have better luck with a more current version.

    Another thing you can try is instead of creating the controls in form design mode, is create all the controls you may need on the form and just manipulate them at runtime. I.e.: Just change the visible property, and set the controls in the right position using top, left, height and width properties. Then there is no design mode, no control creation, and no memory leaks.

  4. #4
    SteveH2508 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Location
    Chelsea, London, England
    Posts
    117
    There is an absolute limit of 754 controls over the lifetime of the form. You will need to find another way of doing what you want.

    http://www.databasedev.co.uk/access_specifications.html

  5. #5
    pmi is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    3
    Thanks a lot guys!
    Consider that when I have to rebuild the form I close and reopen it (i thought this must make me sure to clear the memory used by all the controls just created).

    First of all I'll convert the mdb in 2003 version.
    If this won't work I'll follow the second strategy you suggested to manipulate controls already created (this was the same solution I thought but It was also important for me to understand how Access works to avoid crashes also in other situation)


    Anyway Thanks a lot! For the answer and for the quickness.

    I'll post the result in order to make you know if I've solved the problem

    BYE
    Alex

  6. #6
    pmi is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    3
    Hi everybody,
    I've solved the problem creating 300 texboxes and just hiding/showing the ones I need and moving/sizing them.
    Now I know that deleting object in a form doesn't clear memory and also the deleted controls count in checking the maximum number of controls.
    Thanks a lot for the suggestion.

    PS: converting the mdb in 2003 version didn't solve the problem. I don't know if maybe with 2007/2010 version it could.

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

Similar Threads

  1. Replies: 16
    Last Post: 10-13-2011, 07:52 AM
  2. Out of Memory + Form requery
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 07-20-2011, 12:41 PM
  3. Replies: 1
    Last Post: 03-14-2011, 11:11 AM
  4. Memory & Reports
    By houseofturner in forum Reports
    Replies: 3
    Last Post: 02-16-2011, 05:26 AM
  5. Out of Memory
    By Norman Masson in forum Access
    Replies: 0
    Last Post: 12-29-2008, 11:09 PM

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