Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access/VBE Not Closing

Status
Not open for further replies.

DeanWilliams

Programmer
Feb 26, 2003
236
GB
Hi,

When exiting a certain database the Access process is not terminated. Access looks as if it has closed but I cannot restart Access again without going to task manager and ending the MSACCESS process on the Processes tab.

If I had been in the VBE editor in a session, again Access looks as if it has closed but the VBE remains open with 'No Open Projects' denoted.

This happens on every user's PC when using this same database.

Has anyone experienced this? Does anyone know how to resolve this?

Thanks,
Dean.
 
how are you closing the database?

are you using code, or closing manually with the close button/file menu item?

if you're closing via code, then it could be ur not using the correct close command...

Procrastinate Now!
 
Hi,

Thanks for the quick response.

It happens however I exit Access - through code or with the close buttons.

I am wondering if something is not getting released from memory properly and then Access can't close.
 
Ello,

Make sure you close all instances of objects like recordsets in your code as leaving them open can cause such problems.

Hope that points you in the right direction :)

Sim

----------------------------------------
I was once asked if I was ignorant or just apathetic. I said, "I don't know, and I don't care."
----------------------------------------
 
I have just spent ages going through all the code making sure all object variables are closed and set to Nothing, but I am still having the same problem.

I have noticed that this only occurs if you access a form that uses a disconnected recordset. Not sure if this has something to do with it.

Anyone??
 
Ello,

Can you put up the suspect code so we can have a look?

Sim

----------------------------------------
I was once asked if I was ignorant or just apathetic. I said, "I don't know, and I don't care."
----------------------------------------
 
Narrows it down, but I don't know, just "ranting" along the same lines as previous replies.

Sometimes, when having pending updates one might get an error (or perhaps ambiguious behaviour?) when closing/releasing recordsets. Don't know how/if it would apply for disconnected recordsets, but I often use something like the following when exiting a routine where I've performed updates on ADO recordsets:

[tt]if (not (rs is nothing)) then
if (rs.state=adstateopen) then
if (rs.editmode<>adeditnone) then
rs.cancelupdate
end if
rs.close
end if
set rs=nothing
end if[/tt]

Else I'd try either remove all code and add incrementally, or the other way around, to find if it's a problem relating to that particular code (form code), or if it might be something on the form itself (some added control that may be hung?), or perhaps some sligth form corruption?

Roy-Vidar
 
Hi All,

Finally sorted it! Thanks guys for your help. I had to comment out sections of code at a time to isolate where the problem was.

I was looping through controls to populate them and some of them were calculated controls. I had handled this with an On Error Resume Next statement. However it was still this act of trying to assign values to calculated controls that caused Access not to close. The error number was a system code, -29823770, or something like that. So I just added a line in the loop, to check if first char of the ControlSource is '='.

Cheers,
Dean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top