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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Process not Quitting 1

Status
Not open for further replies.

SmokingCrater

Programmer
Jun 29, 2001
47
US
Created some new forms in the database that my department is using to maintain some information. Now, whenever those new forms are opened to use, the Access process will not end when Access is exited. The Access GUI disappears and it appears as if Access has ended. However the process is still running in the background so when the user attempts to open the database again, (or any other Access database for that matter) the database appears not to open because the GUI does not display. Any ideas on why the process is not quitting would be helpful. I'm pretty sure that there are not any errors as I have setup message boxes to appear when errors occur and no error message boxes ever get displayed. Are there any recordsets that need to be closed when a form is closed? Thanks.
 
Crater:

Do you have any looping code behind the form -- Do While, Do Until, For/Next etc?

If you do, place a break point at the beginning and see if you have an endless loop problem.

May not be the solution, but it's a place to look.
Larry De Laruelle
larry1de@yahoo.com

 
Perhaps this may help?...

"There are two possible causes for this problem:

1. You are using Microsoft Access as an automation server, and you have not closed all references to Microsoft Access or Data Access Objects (DAO).

2. You have not explicitly closed all DAO recordsets or query definitions in your Microsoft Access database. If you are using Visual Basic for Applications code to manipulate recordsets, QueryDefs, or recordset clones (on forms), in some cases you must explicitly close the object; otherwise, Microsoft Access does not close."

Steps to reproduce the problem:

1. Start Microsoft Access and open the sample database Northwind.mdb.

2. Create a module and type the following line in the Declarations section:

Dim objAccess As Object

Type the following procedure:


Sub LeaveOpen()
Set objAccess = CreateObject("Access.Application")
objAccess.Visible = True
End Sub

3. To test this function, type the following line in the Debug window, and then press ENTER:

LeaveOpen

4. When another instance of Microsoft Access starts, switch to that instance.

5. On the File menu, click Exit. Note that the new instance of Microsoft Access minimizes, but does not quit. You must switch back to the first instance of Microsoft Access and close the database. Then the second instance quits automatically because its object variable ceases to exist."

Goodluck!

Gary
gwinn7

 
Larry, thanks for the suggestion, but there is no looping code anywhere.

gwinn7, also thanks for the suggestions but I don't think that's the problem either. I never open any recordsets from within the vb code. I also explicitly close the recordsets that are behind the forms just to make sure they are closed as well.

I think the problem may come from the subform that is on one of the forms. Any reasons why using a subform would cause Access not to kill the process when the database and Access GUI are closed? Again, the recordsets are getting closed because I manually close them when both the forms (form and enclosed subform) are closed. I even created an entirely new form and subform in hopes that there was some old code behind that I couldn't see/edit. Same problem still exists. Does Access have a problem killing the process when forms with subforms are used?

Thanks all. The suggestions posted have been helpful for things to check.
 
Aha!

I think I may have found it. I was perusing some articles this morning and discovered that there is a bug in Access where it has a problem shutting down.

If you implicitly check the condition of a check box in your code, then it can prevent Access from shutting down properly. Like this...

If Me.chkBox then ' <--- Like this.
If Me.chkBox = True then ' <---- Solution

Could this be it Crater?

Gary
gwinn7
 
gwinn,

Interesting bug. Unfortunately, there are no checkboxes/radio buttons/selection controls like that at all. The vb code is very simple as a matter of fact. Which is what baffles me.

Can I ask where you found that? I would like to do some perusing myself. It sounds like a very useful place for information.

Crater
 
I posted a similar question today, where the access process not quitting. I didn't get any responses to my question yet(my subject was not specific enough, posted as Microsoft Access -- sorry). I have a question(for my case anyway), why this behavior on some machines and not others when using the same application, if it's a problem, shouldn't it be the same way on all machines.

Waiting for a solution to a similar problem.
My subject today(7/3/01) posted as Microsoft Access -- from SrkrReds

thanx
SrkrReds
 
srkrreds,

I read your question earlier today. And it seemed very similar. In fact my setup is very very similar where the data and the &quot;gui&quot; stuff are in seperate db's. It makes no sense that it would act differently on different machines. One thing you may want to look at is what software versions and which patches have been installed on the machines. Sometimes if a user installs software, it will screw with certain dll's (not exactly sure which ones) and will sometimes screw up how things execute. Patches will also make a difference. I used to have tons of problems like that with VB apps back at my last position because the users would install non-standard software and muck something up.

My problem is occuring on all machines. And maybe if I find a solution, I can find some way to port it to your problem.

crater
 
Does your program minimize to the taskbar and can't be closed except by ctrl+alt+delete?

If so, I've had the same problem. spent ~ 2 weeks searching..trial and error,error,error, etc... sometimes the problem would 'appear' and sometimes not - I narrowed the search for the culprit to some code running behind a 'query by form'used as the recordsource for a report. I was using &quot;Select Case&quot; for some condition checks (which I thought was the good programmer thing to do) instead of &quot;If,Then,ElseIf&quot;. I changed the Select Case lines to If Then statements .... the problem disappeared!?!?
Not sure if Access treats a Select Case as an implied comparison and If Then as explicit.

hope this is helpful_

jima

 
jima,

thanks for the suggestion. The only code I have running behind the form in question is:
>
Form_newSubEmpAssignment.Recordset.Close 'close subform recordset
DoCmd.Close acForm, &quot;newSubEmpAssignment&quot; 'close subform
Form.Recordset.Close 'close recordset of form
<
And that is encased in the Form_Close funtion. That was an attempt to make sure all the recordsets were closed and the subform got closed. Other than that, there is NO code behind either form or subform. Which is why this problem is extrememly weird. no code, and yet it won't quit. I'm baffled.

Anybody else have any clue whatsoever? I've tried all can think of.

thanks

crater
 
Zorro,

Unfortunately I'm already using Access2000. And the problem is not going away.

I'd like to thank all the users of this forum for the input on my problem. Unfortunately I haven't been able to solve the problem so for the meantime I've used the ExitProcess in the Kernel dll and that works pretty well. Thanks again.

crater
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top