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

Access quits but task remains

Status
Not open for further replies.

paradiso

Programmer
Apr 18, 2002
60
US
Hi friends,

This is another in a long line of postings where we quit Access, but an instance remains active that can only be closed through the Task Manager.

I've read through as many postings as I can find, implemented suggestions, and I have searched the MS Knowledge Base, but still this problem remains:

There is an Exit button on my navigation screen. I use Application.Quit and the program quits smoothly most of the time. However, if I open one particular form (either from the database window or programmatically) and subsquently close it (either using the Close Form button on the form, or the upper right close button (x)) the application fails to close completely when I hit my Exit button on the navigation screen. A minimized but empty task remains on the task bar.

I have commented out all the code in both the forms in question -- only left the Application.quit line in the BtnClose_Click event on the navigation form. Still the simple act of opening and closing this one other form causes it to close differently.

One more thing. If I forget about the button and use File/Exit, the app closes completely.

I am using Access 2002 over XP Pro. I have tried the standard heal-the-database routines, including compact & repair, decompile/compile, import to blank database. I also tried tacking acSaveNone onto the Application.quit command.

Many thanks in advance for insight or suggestions.
 
It seems that somewhere in that one particular form you are create a reference to something, or create an object, which is not being released.

I understand that you have commented out all of the code in the offending form, but what about any queries, macros, and/or any other references that are contained in that form?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Hi CajunC,

The form is unbound; I set the recordsource in the code module when I get an argument sent through openargs. In the current situation, with the calling code commented out and all the module code out too, there is no recordsource at all when I click open the form from the database window.

There is nothing but default values the form properties window and I don't use macros, only code.

I am careful about closing objects and setting the variables to 'Nothing'. However, would any of that be relevant if the code is commented out for the purposes of debugging? Access wouldn't be secretly processing commented-out code, would it?

many thanks,
p
 
Obviously no way to be sure, but the indications imply a hanging reference. Are all the controls unbound? Is it a subform? Are there any linked fields?

If the form is not that complex, then as a last resort, I might delete the form, and rebuild it from scratch.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Hey there,

Most of the controls are bound simply to the fields returned by the recordsource query (established at Form_Open). However, there are two that have =IIf expressions in the ControlSource field on the Form Properties form, with the conditions testing the values of other controls in each detail record (as in if this check mark is true, show this text). A third control shows a total, so the controlsource box reads =([ThisControl] + [ThatControl] + [NextControl]). Controls in question are currency data types.

Oh, and it is not a subform, and I have tried to rebuild it from scratch but maybe that's not really valid because I pasted in the controls. I don't know what a linked field is, so I am not sure about that. The trouble may well lie in the controls. I'll play with them for a while.

p

 

RESOLVED!

But how obscure is this?

In the Control Source field on the Form Properties I had

=IIf([CatTotal].Value<>[FullYearForecast],&quot;?&quot;,&quot;&quot;)

Take away the '.Value' to fix, leaving

=IIf([CatTotal]<>[FullYearForecast],&quot;?&quot;,&quot;&quot;)

Now the program closes completely.

This is one of those cases where VB practice does not work in Access. And so Access leaves an open application as inscrutable punishment.

Thank you CajunCenturion, for your suggestions to study the controls. Best wishes for the new year.

p
 
Glad that this has been resolved.
Thank you, and you too have a wonderful year.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top