Closing Access opens another (non closable) instance

R

RzB

I have a db under development. Last night I
made some changes to a sub form. After the
changes I have a very interesting but unwanted
effect! When I close the Application then close
Access it pops up with another Access window.
This empty access window will not go away.
The only way to get rid of it is to go into the
Task Manager and End Task. Compact/Repair
has no effect.

I have hunted through Google/KB Articles but
can't find anything that looks similar.

Is this a known problem?

I'm about to regress to the backup made before
last nights changes. We shall see.....

Win Xp, Access 2002 all latest updates etc..

Many thanks,
Roy
 
M

Marshall Barton

RzB said:
I have a db under development. Last night I
made some changes to a sub form. After the
changes I have a very interesting but unwanted
effect! When I close the Application then close
Access it pops up with another Access window.
This empty access window will not go away.
The only way to get rid of it is to go into the
Task Manager and End Task. Compact/Repair
has no effect.

I have hunted through Google/KB Articles but
can't find anything that looks similar.

Is this a known problem?

I'm about to regress to the backup made before
last nights changes. We shall see.....

Win Xp, Access 2002 all latest updates etc..


Can't tell for sure, but that problem is usually caused by
an dangling reference to some kind of object. Most
commonly, it's an open recordset, but there are any number
of other type of objects that might cause this problem.
The general rule to avoid the issue is to Close everthing
you open (using OpenRecordset, OpenDatabase, etc) and set
every object to Nothing when you are done using it.

Search through your code for sequences that do not conform
to the following outline:

Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset( . . .
. . .
rs.Close
Set rs = Nothing
Set db = Nothing

Note that, since db was not opened (just assigned to the
object variable), it should not be closed.
 
R

RzB

Marshal,
Many thanks for your help. Hmm - I am
usually pretty careful about closing/destroying
objects/recordsets etc. I'll take a close look
at the changes I made again to see if I screwed
summat up...
Many thanks,
Roy.
 
R

RzB

Oooo - Sussed it. Some of the changes I had made
to the sub form were to make a couple of text boxes
unbound (they were previously bound to a table) and
fill them using code. After crawling painstakingly through
all the code updates I had made I realised that it was
nothing to do with the code. I had forgotten to blank
out the Control Source field in the properties! D'oh!
Once done all was well!
Many thanks for the suggestions anyway...
Roy
 
M

Marshall Barton

RzB said:
Oooo - Sussed it. Some of the changes I had made
to the sub form were to make a couple of text boxes
unbound (they were previously bound to a table) and
fill them using code. After crawling painstakingly through
all the code updates I had made I realised that it was
nothing to do with the code. I had forgotten to blank
out the Control Source field in the properties! D'oh!
Once done all was well!


That prevented Access from closing???

Gee, that's a totally new one on me. Normally, a control
source to a nonexistent field would just cause a parameter
prompt. There must a little more to it, but I can't see
what it might be.
 
R

RzB

Hmm - yes makes you think.

The fact is the table still existed - so the Control Source
info was genuine. The table has only five records each
with five fields. The data is informational as far as the
user is concerned - he is not able to update the info.
The text boxes it is displayed in are not enabled and locked.

The change I made was to remove the navigation buttons
and give the user five buttons with meaningful Captions to
select which record he displays. It obviously screwed up the
data in my table but I don't see why it would open another
instance of Access - and a non closeable one at that!

Any idea?
Roy
 
M

Marshall Barton

RzB said:
Hmm - yes makes you think.

The fact is the table still existed - so the Control Source
info was genuine. The table has only five records each
with five fields. The data is informational as far as the
user is concerned - he is not able to update the info.
The text boxes it is displayed in are not enabled and locked.

The change I made was to remove the navigation buttons
and give the user five buttons with meaningful Captions to
select which record he displays. It obviously screwed up the
data in my table but I don't see why it would open another
instance of Access - and a non closeable one at that!

Any idea?

It certainly sounds bizarre and no, from what you've
described, short of corruption, I have no idea how something
like that could happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top