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

Appication.Quit - but Access stays open ???

Status
Not open for further replies.

hayo

MIS
Sep 14, 2001
56
0
0
DE
I have a secured Access 97 frontend. The mdw-file sits on a network drive, the frontend on each users pc.

With certain events, the command

"Application.Quit acExit"

is submitted from the frontend to exit immediately. I do this to be able to open the mdw-file exclusively.

Problem: If some Messagebox is open at this time, the frontend quits, but Access is still active on the taskbar and must be closed with the task manager.

And the mdw-file is still blocked !!

How can I make sure that Access is closed completely ??

Thanks for your help - its urgent.

Hayo
 
Hayo,
A few months back, I posted a tip on this...I can't remember the thread#, but essentially the problem (in my case) was that I had referred to a form control--a checkbox in this case, with a dot instead of a bang (!). Changing all references to user-defined controls to bang solved this. Also, curiously, the checkbox was being tested for True by the implicit 'True', ie "If me.chk1 Then" instead of "If me.chk1 = true Then". Changing to the explicit '= True' solved it even while retaining the dot instead of the bang.

However, I still recommend changing all the user control refs to bang; I know it's easier to let ms autolookup just pop down the control names when you use the dot, but the bang is the correct syntax. In the case where (especially with Wizard-created forms) the textbox Name is the same as the textbox ControlSource, this could cause some confusion, but Access will find the right object if, say you refer to the .Text property, which the texbox has, but the controlsource doesn't--it's a property all it's own that happens to have the same name value as the textbox.

In Access 2.0, same-named textboxName/Controlsource caused problems since different behaviour resulted depending on which object Access chose to use--a controlsource might not allow nulls but the texbox itself could be null, etc. This was dealt with, I believe, in Access 95
--Jim
 
Hi Jim !

Your notes to the usage of dot and bang were very intersting, I am changing all statements, where I did not follow this rule.

Nevertheless, it does not solve the problem.

I think you can easily recreate it:

create a new app with 1 form.
Place a button on it. If you press the button, then display a msgbox.

Add a timer interval to the form (eg. 10000 for 10 seconds). As the timer event, specify

"Application.Quit acQuitSaveNone".

Now test 2 things:

Open the app, open the form and wait ... After about 10 seconds, the app quits completely.

Then open the app again, open the form, and press the button. The messagebox appears. Please wait.....

After 10 seconds, the apps quits, but Access stays in the task bar !!

Hayo
 
Hayo,

I was intrigued by your post. I tried to recreate the problem you are having. And I could not. I created the form, used the timer to quit the app and created the button with the message box.

When I open the form an wait, the app closes as expected.
When I open the form, the use the button, the msgbox receives focus and and nothign happens until I close that box. When I close the message box, the form receives focus and then it closes at timer interval. The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Hi Robert,

thats interesting. Whats happening ??

I use Access 97 as frontend (not Access 2000).

When I open the app, then open the form, and press the button, then the msgbox receives focus. ok.

But the form is still open, and the timer is running !
Consequently, after 10 seconds (with msgbox having the focus), the app is shut down (but with a dead process active).

Do you have an idea, why your app does not close, even if the form with the timer is open ?

Hayo
 
i have a similar problem with access getting stuck on the task bar. i have multiple databases that i open from a common logon db. i've noticed that if i open another db, exit,and then exit the common logon db access instance gets stuck. the weird thing is that if i use a user that is part of the Admins group acess closes down without any problems. does anybody know why this is happening? when i exit i have a function call that resets the menu and the the Application.Quit statement.
 
Jim,

another question to dot and bang usage:

What should be done with expressions starting with "Me" ?

In your sample, you use a dot here. Is that ok ?

Hayo
 
Hey people

When I joined the company i'm working for now - this problem was a common occurance, it took me a long time to trawl through all the Forms and code to fix the problem, but I persevered and Access closes correctly each time now!

There are 2 known causes, for this problem that Microsoft have declared as bugs.
1) Not closing everything you open, in code when you open a table or query you should ensure you always close it - rst.close
set rst=nothing

2) Evaluating a boolean on a main form from a subform, using it in an if without declaring if Tick = true then, as mentioned above.


Try this link:

It explains it better than me!

Andy
 
I use the command
docmd.quit
to exit out of my database... works like a charm...

btw, i'm going to be changing all my user defined types to a bang too:) thanks man...

(I want to have good form and all:))

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top