OnUnload Error

K

Kevin

I have an application that I have prevented the user from
exiting unloess they use my "Quit" button. I got the
technique from this newsgroup as I recall and it has
worked quite well. During development of the application
everything worked well, during testing, everything worked
well, but... When I deployed the application I started
getting an OnUnload Error. There is onloy one OnUnload
event in the application and it involves this
functionality. I have a form open in the background which
has a hidden field on it. I set a field on this form to a
default value of "False". The OnUnload function that runs
has the following code:

foKtoClose = Forms![MyForm]![OkToClose]

Cancel = Not foKtoClose

If the user simply clicks the "X" on the application
nothing happens. They have to use the Quit button. I do
this because I have specific actions I have to take before
closing the application to clean up the backend database
and close out their session.

I posted a question for help on this several weeks ago and
someone suggested I might have a problem with references.
My problem is on the computers this is happening on all do
not have Access installed. I use the Runtime only. The
deployed application is an mde. Someone, and at this point
I do not recall who, suggested I use the following code to
output the references to the watch window, but without
Access I can not get to the Watch Window.

For Each ref In Application.References
Debug.Print ref.Name, ref.FullPath, ref.IsBroken
Next ref


Is there a way to send this output to a text file so I can
look at the information that way?

Any help or suggestion would be greatly appreciated!!!!!

Kevin
 
A

Allen Browne

Kevin, I think I gave you the code to loop through the references and export
them to a text file.

Trouble is, that code probably won't work if the references are broken,
*because* the references are broken, so code does not work.

Read michka's article:
How to guarantee that references will work in your applications
at:
http://www.trigeminal.com/usenet/usenet026.asp?1033
 
K

Kevin

Thanks Allen! I will check out the information.
-----Original Message-----
Kevin, I think I gave you the code to loop through the references and export
them to a text file.

Trouble is, that code probably won't work if the references are broken,
*because* the references are broken, so code does not work.

Read michka's article:
How to guarantee that references will work in your applications
at:
http://www.trigeminal.com/usenet/usenet026.asp?1033

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have an application that I have prevented the user from
exiting unloess they use my "Quit" button. I got the
technique from this newsgroup as I recall and it has
worked quite well. During development of the application
everything worked well, during testing, everything worked
well, but... When I deployed the application I started
getting an OnUnload Error. There is onloy one OnUnload
event in the application and it involves this
functionality. I have a form open in the background which
has a hidden field on it. I set a field on this form to a
default value of "False". The OnUnload function that runs
has the following code:

foKtoClose = Forms![MyForm]![OkToClose]

Cancel = Not foKtoClose

If the user simply clicks the "X" on the application
nothing happens. They have to use the Quit button. I do
this because I have specific actions I have to take before
closing the application to clean up the backend database
and close out their session.

I posted a question for help on this several weeks ago and
someone suggested I might have a problem with references.
My problem is on the computers this is happening on all do
not have Access installed. I use the Runtime only. The
deployed application is an mde. Someone, and at this point
I do not recall who, suggested I use the following code to
output the references to the watch window, but without
Access I can not get to the Watch Window.

For Each ref In Application.References
Debug.Print ref.Name, ref.FullPath, ref.IsBroken
Next ref


Is there a way to send this output to a text file so I can
look at the information that way?

Any help or suggestion would be greatly appreciated!!!!!

Kevin


.
 
G

Guest

Kevin, If I well understood and if "I have prevented the user from exiting
unless he/she use my 'Quit' button" means when he/she click on the "X" close
button the window stay alive. I am very interested in the thechnique you use.
Because I am not so lucky than you and I have not yet been able to find out
such javascript code in this forum.

Thanks in advance if you can provide me with it, because what you did is
exactly what I want to do (without Access communication it is pure JS).

JML
 

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