UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> onclose event causing crash    
 
   
IainIOW
post Mar 2 2005, 03:39 AM
Post #1

UtterAccess Veteran
Posts: 408
From: Isle of Wight UK



Hi, ive got an event on a form that runs through an onclose event. it is in effect a "log off" log. ive used the security demo from here and the whosloggedon form runs in the backgorund of the database. I am trying to get a log off feature, so when a user closes out of the database, it records it. This works fine if i simply close the form the event is attached to (i.e. the main switchboard) but if i close the application by crossing it off and not directly closing the form - i get an application error asking if i would like to send the error to microsoft & if i would like to restart access.. any idea how i can play this a bit more effectivly?!
thanks
Go to the top of the page
 
+
JayNoelOlimpo
post Mar 2 2005, 03:46 AM
Post #2

UtterAccess VIP
Posts: 7,990
From: Philippines



Could you post your code ...

Maybe there's an offending code there ...
Go to the top of the page
 
+
IainIOW
post Mar 2 2005, 03:50 AM
Post #3

UtterAccess Veteran
Posts: 408
From: Isle of Wight UK



HI, thanks for your reply..

This is the onclose event code

DoCmd.OpenForm "Logoff"

The form Logoff has an onload event as:

If Me.NewRecord Then
Me.Date = Now()
Me.Whos_Loggedon = fOSUserName()
Me.null = "User Logged off"
DoCmd.Close
End If

This is supposed to add a new record and fill in username, date and the text logoff. Which it does if closing by simply closing the form.
Thanks
Go to the top of the page
 
+
JayNoelOlimpo
post Mar 2 2005, 04:14 AM
Post #4

UtterAccess VIP
Posts: 7,990
From: Philippines



Date is a reserved word ...
Null too ...

Rename those fields ...
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th May 2013 - 03:04 PM