OnUnload Form Error

K

Kevin

I have developed a database in Access 97. The system is
designed with a front end application that resides on the
users system and a backend database on a network drive.
One of the features tracks who is logged on to the
database at any one time. I do this by grabbing their
network user ID and network computer name from the Windows
API and stiking that information into a table in the
backend database. When they log off, the information is
deleterd from the table using an OnUnload event in a form
that is cloased as the appplication closes down. during
testing both on my computer and another system we had no
problems, but now we are getting an on unload error and it
is coming from this event. I have verified the module is
doing everything I need it to do, it is just the annoyance
of the error message. The computers we are seeing this on
are Windows 2000 Pro multiuser systems. My system
(development and test system) and the other test system
are both single user Windows 2000 Pro systems.

Also, I have tried tracing this in an mdb and do not have
the problem. Only when it is converted to an mde.

Any ideas?

Thanks in advance.


Kevin
 
D

Dirk Goldgar

Kevin said:
I have developed a database in Access 97. The system is
designed with a front end application that resides on the
users system and a backend database on a network drive.
One of the features tracks who is logged on to the
database at any one time. I do this by grabbing their
network user ID and network computer name from the Windows
API and stiking that information into a table in the
backend database. When they log off, the information is
deleterd from the table using an OnUnload event in a form
that is cloased as the appplication closes down. during
testing both on my computer and another system we had no
problems, but now we are getting an on unload error and it
is coming from this event. I have verified the module is
doing everything I need it to do, it is just the annoyance
of the error message. The computers we are seeing this on
are Windows 2000 Pro multiuser systems. My system
(development and test system) and the other test system
are both single user Windows 2000 Pro systems.

Also, I have tried tracing this in an mdb and do not have
the problem. Only when it is converted to an mde.

Any ideas?

Thanks in advance.


Kevin

Please post the error number and message, and the code you are running
in the Unload event.
 
K

Kevin

Dirk,

I get no error number. I did not see this error until I
completed development and began to install the application
(as an mde) on systems throughout our facility. The error
message reads as follows:

The Expression On Unload you entered as the event property
setting produced the following error:

* The expression may not result in the name of a macro,
the name of a user defined function or [Event Procedure].
* There may have been an error evaluating the function
event or macro.

The On Unload event is a VBA form module and worked fine
during testing. It gave me no problems. On my system it
gives me no problems. On another test system it gives us
no problems. On a Windows 98 system it gives us no
problems. On the other Windows 2000 Pro systems it causes
this error and it is driving me NUTS!!! It is really only
a nusance error bacause it does what it needs to do.

The only code in the event procedure is as follows:

foKtoClose = Forms![HiddenForm]![OkToClose]

Cancel = Not foKtoClose

All this does is allow the form to close after the code
runs and even with the error, it does allow the form to
close.

I know which event this is because I have only one such
event in my application, but I am not sure why it is
happening.

I appreciate your help!!

Kevin
 
D

Dirk Goldgar

Kevin said:
Dirk,

I get no error number. I did not see this error until I
completed development and began to install the application
(as an mde) on systems throughout our facility. The error
message reads as follows:

The Expression On Unload you entered as the event property
setting produced the following error:

* The expression may not result in the name of a macro,
the name of a user defined function or [Event Procedure].
* There may have been an error evaluating the function
event or macro.

The On Unload event is a VBA form module and worked fine
during testing. It gave me no problems. On my system it
gives me no problems. On another test system it gives us
no problems. On a Windows 98 system it gives us no
problems. On the other Windows 2000 Pro systems it causes
this error and it is driving me NUTS!!! It is really only
a nusance error bacause it does what it needs to do.

The only code in the event procedure is as follows:

foKtoClose = Forms![HiddenForm]![OkToClose]

Cancel = Not foKtoClose

All this does is allow the form to close after the code
runs and even with the error, it does allow the form to
close.

I know which event this is because I have only one such
event in my application, but I am not sure why it is
happening.

My guess is that your problem comes from a broken reference. If you put
the .mdb file -- not the .mde -- on the computers where the .mde is
failing, do you get an error under the same circumstances? If so, check
the Tools -> References. dialog for references marked as MISSING. If
not, check the actual reference paths of all the references in the
database, using code like this:

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

and compare the results printed in the Immediate Window with those you
get with the same code run in your development machine.

Also, if the .mdb works and the .mde doesn't, what happens if you
actually *make* the MDE on a machine that is having this problem. Does
the MDE work then?
 
K

Kevin

I'll try that and post back if I need more help. Thanks
for the help!

Kevin
-----Original Message-----
Dirk,

I get no error number. I did not see this error until I
completed development and began to install the application
(as an mde) on systems throughout our facility. The error
message reads as follows:

The Expression On Unload you entered as the event property
setting produced the following error:

* The expression may not result in the name of a macro,
the name of a user defined function or [Event Procedure].
* There may have been an error evaluating the function
event or macro.

The On Unload event is a VBA form module and worked fine
during testing. It gave me no problems. On my system it
gives me no problems. On another test system it gives us
no problems. On a Windows 98 system it gives us no
problems. On the other Windows 2000 Pro systems it causes
this error and it is driving me NUTS!!! It is really only
a nusance error bacause it does what it needs to do.

The only code in the event procedure is as follows:

foKtoClose = Forms![HiddenForm]![OkToClose]

Cancel = Not foKtoClose

All this does is allow the form to close after the code
runs and even with the error, it does allow the form to
close.

I know which event this is because I have only one such
event in my application, but I am not sure why it is
happening.

My guess is that your problem comes from a broken reference. If you put
the .mdb file -- not the .mde -- on the computers where the .mde is
failing, do you get an error under the same circumstances? If so, check
the Tools -> References. dialog for references marked as MISSING. If
not, check the actual reference paths of all the references in the
database, using code like this:

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

and compare the results printed in the Immediate Window with those you
get with the same code run in your development machine.

Also, if the .mdb works and the .mde doesn't, what happens if you
actually *make* the MDE on a machine that is having this problem. Does
the MDE work then?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 

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