Run-time error '2004'

  • Thread starter Thread starter HelenJ
  • Start date Start date
H

HelenJ

I have taken over a database and I am having a problem with a form. It works
fine for a while and then I get the: Run-time error '2004' There isn't enough
memory...." error message.

The first time it happened I copied in a version of the form from a backup
database. It then happened again and even though the form would work in
another database when I copied it in to the one with the error, it then
produced the error.

So I created a new empty database and copied everything across - all was
again fine. Then the same error happened again. At the moment it is working
with a copied in old version of the form, but I would really like to stop
this happening.

The database is not currently split - do you think doing this would help? I
don't want to go down this route if it won't (and yes I know it is best
practice) because that would involve a site visit and a lot of cost.

Any thoughts cos this is driving me grey!!! :-)

Thanks
Helen
 
Hi Helen,

What is the size of the memory on your computer? Do you have a lot of
free disk space? If you have lots of memory and disk space, it might be a
memory leak. Memory leaks are where something never completely removes
objects it creates, even when done with them. Does the problem temporarily
go away if you close out of Access and then reopen the database? What
version of Access are you using? Have you gone out to Microsoft's update
site to make sure your version of Office is totally up-to-date? If not, do
so. Are there other forms in the database? Do they have the same trouble?
How many controls (text boxes, labels, combo boxes, and so forth) are on the
form? Does the form deal with/use images? What is the total size of the
database? 2GB is the maximum. If you are close to that, splitting might
help with the problem. If making sure you are up-to-date does not help, post
the code and/or macros associated with the form. Maybe there will be
something in there that will stick out as a cause.

Clifford Bass
 
Hi Clifford,

Thanks for your thoughts but I don't think any of that is really helpful.
This problem occurs on several different machines (I am not on the same site
as where the database is used), I am running it on 2007 with XP, but the same
problem occurs on networked PCs that are using Access 2003.

From what I have read elsewhere I think it is a coding error, but I have
tried recompiling the code but that still hasn't helped.

Helen
 
Hi Helen,

Since the problem occurs on multiple machines with different versions
of Access, I would concur that the problem is not PC or Access specific.
Which as you state leaves something about the form. Or something about the
database. You did not answer the questions specific to the form or if the
trouble happens with other forms in the same database or about the size of
the database. Care to answer those? And/or post the macros/code associated
with the form?

Clifford Bass
 
Are there other forms in the database?

Yes quite a few
Do they have the same trouble?
No

How many controls (text boxes, labels, combo boxes, and so forth) are on the
form?

I'm going to say "lots" - this is a form with 4 subforms on tabs
Does the form deal with/use images?

There is a link to an image (ie one per form), but when I run the database I
don't link and there is still a problem (intermittently, or rather terminally
on an infrequent basis)
What is the total size of the database? 2GB is the maximum. If you are close to >that, splitting might help with the problem.

It's about 6Mb, so not that large really
If making sure you are up-to-date does not help, post the code and/or macros >associated with the form.

There is a lot of code (and some modules) associated with the form and the
subform, so that's not really possible. As I say I re-compiled the code,
nothing obvious came up (there were a few problems with some half completed
development work (unrelated to "The" form) that I then deleted, but the form
still came back with the same error. So I guessing that you don't think
splitting will solve the problem?

Thanks

Helen
 
Hi Helen,

It looks more like it has to do with the form or the code behind it.
It could also be some kind of corruption. You could try a decompile /
recompile (see <http://www.granite.ab.ca/access/decompile.htm>) to see if
that makes a difference. The size of the database is definitely on the low
end, so I doubt splitting it would make a difference. Unless you have
multiple users. You might want to check out
<http://www.granite.ab.ca/access/corruptmdbs.htm> to see if there is anything
there that may help.

Good Luck,

Clifford Bass
 
I tried the decompile, but I have no way of telling if it worked. It seemed
very fast and it made no difference to the size of the database and it seemed
to be very fast!

I then recompiled, but this still doesn't make the original form that
produces the error work. So whether running all of this will make it stay
fixed for longer or not I really don't know.

I also looked at the suggestions about corrupt databases, but I couldn't
save a copy of the form (Error 2004, out of memory) and when I tried to
export it as a txt it crashed the database.

There are multiple users of the database, but I'm not sure this is the
problem.

I would still love to know why this keeps happening and how to prevent it.

Thanks for your help Clifford, but I'm not sure I am any further forward
(which is often the way when you can't re-create a problem!)

Helen
 
Hi Helen,

I do not see my prior post, so here goes again.

As the problem is intermittent, it is hard to diagnose and I concurr,
you probably are not any better off. Since there are multiple users, do go
ahead and split the database. See
<http://www.granite.ab.ca/access/autofe.htm> for a way to automatically
update each user's copy of the front end on their computers whenever you make
changes to the front end. If you still have troubles, if it all possible,
you could try splitting the form into two forms; each with two subforms each.
I realize that may or may not be workable due to situation.

Good luck!

Clifford Bass
 
Back
Top