Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2005
    Posts
    20

    Unanswered: add some code to a control and now it says out of memory? (was "Odd")

    Hi there,
    I have written an Access application as normal.
    I just tried to add some code to a control and now it says out of memory?
    I have removed all the other controls AND code and its still giving this error.

    Any ideas??

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    What kind of control?
    Where is the control?
    What is the code?
    What is the code supposed to do?

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Hi dave
    have had similar problems off and on for a while, it may not be Access that has the problese, it could be that you have run another program which has done the damage. I find graphical editors, especially from the Macromedia range are lethal to system resources......

    have no idea what in Access could eb casuing the problem though.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    This may seem like a stupid question but HOW long have you had the Access db session running? Have you been running forms that have been blowing memory by the acre? Have you closed the DB and reopened? Have you run a compact and repair?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I'll get an "Out of Memory Error" when I make changes to an Access App on occasion. It seems to only happen in Access 97 with an older version of Jet (appropiate for Acc 97) and only when I make changes to code.

    I have not been able to consistently reproduce the error, so I haven't figured out the genuine cause. My customer has never reported this error, so it's probably a developer's pothole.

    I resolve it by "/Decompile", then "Compile and Save All Modules".

    I recall reading a MSDN KB article about a limitation in Jet resulting from too much code in the Access FE. The article said something about adjusting the amount of memory allocated to Jet in the registry.

    Hope this helps ...

  6. #6
    Join Date
    Jan 2005
    Posts
    20
    Basically the form in question has a bunch of list boxes looking at different tables via queries, there are about 15 of these. The query counts the stock of each item. Next to the list box I have a button that syas 'add stock', this just opens an update stock form where I add stock. The code closes the form where you can see the stock before it opens the other.
    I always have my code close the forms because I dont want lots of forms open.
    The size of the database has jumped from 7 meg to 116meg. Seems pretty bloody weird to me.

    I have compacted and repaired, I have rebooted, I have downloaded all updates I can find and still I get the error. At the moment I am going to cut and paste all the tables and forms etc in to a new database to try and isolate the problem

  7. #7
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    as suggested by Todd, have a go on a COPY of your .mdb with /Decompile
    and perhaps read this before you start.

    ...on a copy!!!!!!

    izy
    currently using SS 2008R2

  8. #8
    Join Date
    Jan 2005
    Posts
    20
    OK ok
    I tried all of that and it still is 130MB, interestingly when I zip it down using winzip it compacts down to about 3MB which is what I expect the size should be. There is no data in there, i am using a lot of strings, I have a form that looks at 14 queries but big deal. I am not sure what to do really!

  9. #9
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi David

    To confirm - you have an empty db that takes up 130 MB. No data. Any graphics in any objects? Did you compact and repair after deleting (access doesn't actually delete anything until a compact and repair - stuff is just flagged for deletion until then)?

    You say you have lots of strings - what are these strings?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  10. #10
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    Try creating a new (empty) database and then progressively importing each object from the original one, monitoring the growth in size after each import. This might tell you where a problem exists (if the cause lies in the database itself). I think I have on occasion identified cross-module function calls as creating both size and performance difficulties, but this is rather vague. I have recently taken over maintenance of a system which had two modules with 40,000+ lines of VBA and three more of 15,000+ ! I used the technique I have described to zoom in on matters requiring early attention.

  11. #11
    Join Date
    Feb 2002
    Posts
    108
    Quote Originally Posted by davidcoombs100
    Basically the form in question has a bunch of list boxes looking at different tables via queries, there are about 15 of these. The query counts the stock of each item. Next to the list box I have a button that syas 'add stock', this just opens an update stock form where I add stock. The code closes the form where you can see the stock before it opens the other.
    I always have my code close the forms because I dont want lots of forms open.
    The size of the database has jumped from 7 meg to 116meg. Seems pretty bloody weird to me.

    I have compacted and repaired, I have rebooted, I have downloaded all updates I can find and still I get the error. At the moment I am going to cut and paste all the tables and forms etc in to a new database to try and isolate the problem



    Here is your problem, 15 search boxes all calling different tables or queries. You should try making the "rowsource" for all of the list boxes empty except for the one the has the focus. What is happening is, even though each one individually may be ok, when you call up the form, you are actually calling all of the "Entire" tables into memory. I had this problem for a long time, because we had several forms that had several subforms, and it was opening each table and having all of the records in memory. The prob stopped when we coded system to not have a record source until we changed the focus to that subform. In your case (with list boxes) you need to make the "rowsource" = "" until you change the focus to the list box, remember to change the rowsource back to blank when you change focus to another listbox or you still have those records in mem as well.

  12. #12
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    have recently taken over maintenance of a system which had two modules with 40,000+ lines of VBA and three more of 15,000+
    I seem to recall reading something somewhere about how Access uses Jet's resources to store and compile code - what version of Access are you using?

    Anyway, does your code create and delete objects in the db? Every time you create an object, space is reserved for it. When you delete the object, it looks like it is gone, but the space is still consumed until you compact. This is generally refered to as "ballooning" - something Access is very good at doing.

Posting Permissions

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