Error in Log Each User's Session Guide

In creating a log that will track each user's entering and exiting the 
database, I followed the link provided by Gunny (Thanks so much, Gunny!) -

http://www.access.qbuilt.com/html/session_logs.html

And I've implemented all the necessary steps.  There's only one "oddity" for 
my database - I currently have to use a frm_Welcome_Menu that everyone has to 
have opened 1st.  What I did was I put an Event Procedure in the event "On 
Open" which, I was hoping, would call the frmHidden and then proceed with the 
rest of the coding.  Below is my "On Open" event procedure.

DoCmd.OpenForm "frmHidden", , , , , acHidden
   
   On Error GoTo ErrHandler

DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
Me!txtUserName.Value = CurrentUser()
Me!txtComputerName.Value = CurrentObjectName()
Me!txtBeginTime.Value = Now()
RunCommand acCmdSaveRecord

Exit Sub

ErrHandler:

MsgBox "Error in Form_Open( ) in" & vbCrLf & _
   Me.Name & " form." & vbCrLf & vbCrLf & _
   "Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear

End Sub


Then, in the "On Unload" Event Procedure, I have the following -


Private Sub Form_Unload(Cancel As Integer)

On Error GoTo ErrHandler

DoCmd.OpenForm "frmHidden", , , , , acHidden
Me!txtEndTime.Value = Now()

Exit Sub

ErrHandler:

If (Err.Number = 2448) Then
   ' Ignore, since the form is going into Design View.
Else
   MsgBox "Error in Form_Unload( ) in" & vbCrLf & _
   Me.Name & " form." & vbCrLf & vbCrLf & _
   "Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
End If

Err.Clear
   
End Sub


I've saved everything and reopened the database - Whenever I try to close 
the Welcome Screen (to exit) I get the following error -

Error in Form_Unload() in
frm_Welcome_Screen form.

Error # 2465

Microsoft Access can't find the field "txtEndTime" referred to in your 
expression.

I've double checked and ensured that my text control box for this field is 
named "txtEndTime" - Promise!

I know this is a simple fix and I'm obviously overlooking something simple; 
would anyone mind pointing out my flaw(s)?  :)

As always, I greatly appreciate each of your input and assistance on this 
matter!  

VF
0
Utf
10/30/2007 5:13:01 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
757 Views

Similar Articles

[PageSpeed] 29

Its not entirely clear where you've placed your code.  Since you have 
deviated from the posted methodolgy (for valid reasons), it's important to 
know exactly what is where. (The error message indicates you've confused 
Access as well). I was unable to figure out what combination of things would 
lead to that error message and only that error message, so this is my best 
guess.

It sort of sounds like frmWelcomeMenu contains the 4 bound fields *and* all 
the code, not frmHidden?

*If* frmWelcomeMenu has the bound fields and the code then you can try this:
    1) Remove all references to frmHidden in your code (and delete the form. 
Its not doing anything, is it?)
    2) In the OnUnload event:
        If Me.Visible Then
            ' User clicked close
            ' Cancel the close action, then hide the form instead
            Cancel = True
            Me.Visible = False
        Else
            ' Since we're already hidden, the app must be closing. Log it.
            Me!txtEndTime.Value = Now()
        End If

Otherwise, I'd suggest you go back and follow the instructions as posted.

The guiding principles behind the whole idea are:
    -Open frmHidden (containing the 4 bound fields and OnOpen & OnUnload 
code) when the application starts.
         (Note: frmHidden could be opened from the Open event of another 
form.)
    -In the OnOpen event of *frmHidden*, create & start your log record.
    -In the Unload event of *frmHidden* (which will fire when the user exits 
the application), log the end time.

You can substitute frmWelcomeMenu (or any form) for frmHidden, but you need 
to make sure it stays open as long as the application does (hidden or not) 
*and* that it has the 4 bound fields and all the code attached to it.

Since frmHidden is always open, there is no need to open it a 2nd time (as 
you are doing). If properly set up, that would create a 2nd "log in" record 
as the user is logging out, greatly confusing matters.

HTH,


"Vylent Fyre" <VylentFyre@discussions.microsoft.com> wrote in message 
news:E1D655C9-6531-402D-8E14-653220653E60@microsoft.com...
> In creating a log that will track each user's entering and exiting the
> database, I followed the link provided by Gunny (Thanks so much, Gunny!) -
>
> http://www.access.qbuilt.com/html/session_logs.html
>
> And I've implemented all the necessary steps.  There's only one "oddity" 
> for
> my database - I currently have to use a frm_Welcome_Menu that everyone has 
> to
> have opened 1st.  What I did was I put an Event Procedure in the event "On
> Open" which, I was hoping, would call the frmHidden and then proceed with 
> the
> rest of the coding.  Below is my "On Open" event procedure.
>
> DoCmd.OpenForm "frmHidden", , , , , acHidden
>
>   On Error GoTo ErrHandler
>
> DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
> Me!txtUserName.Value = CurrentUser()
> Me!txtComputerName.Value = CurrentObjectName()
> Me!txtBeginTime.Value = Now()
> RunCommand acCmdSaveRecord
>
> Exit Sub
>
> ErrHandler:
>
> MsgBox "Error in Form_Open( ) in" & vbCrLf & _
>   Me.Name & " form." & vbCrLf & vbCrLf & _
>   "Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
> Err.Clear
>
> End Sub
>
>
> Then, in the "On Unload" Event Procedure, I have the following -
>
>
> Private Sub Form_Unload(Cancel As Integer)
>
> On Error GoTo ErrHandler
>
> DoCmd.OpenForm "frmHidden", , , , , acHidden
> Me!txtEndTime.Value = Now()
>
> Exit Sub
>
> ErrHandler:
>
> If (Err.Number = 2448) Then
>   ' Ignore, since the form is going into Design View.
> Else
>   MsgBox "Error in Form_Unload( ) in" & vbCrLf & _
>   Me.Name & " form." & vbCrLf & vbCrLf & _
>   "Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
> End If
>
> Err.Clear
>
> End Sub
>
>
> I've saved everything and reopened the database - Whenever I try to close
> the Welcome Screen (to exit) I get the following error -
>
> Error in Form_Unload() in
> frm_Welcome_Screen form.
>
> Error # 2465
>
> Microsoft Access can't find the field "txtEndTime" referred to in your
> expression.
>
> I've double checked and ensured that my text control box for this field is
> named "txtEndTime" - Promise!
>
> I know this is a simple fix and I'm obviously overlooking something 
> simple;
> would anyone mind pointing out my flaw(s)?  :)
>
> As always, I greatly appreciate each of your input and assistance on this
> matter!
>
> VF 


0
George
10/30/2007 10:37:04 PM
Reply:

Similar Artilces:

Business Portal Error-SQL server does not exist or access denied
Hi, We are running business portal 4.0 for one of our customer. It was running correctly, however, they have changed the SQL server port (previously it was set as default 1433). After that the business portal becomes very slow and while creating a new request (purchase requisition) if we open the item pop up; it is showing exception "SQL Server does not exist or access denied...." Can any body tell me how can I provide the new port number to business portal connection to the database. Thanks and Regards, Waliullah, Thanks for using the newsgroups. I have a...

Removing multiple users from Outlook
We did some computer switching, which involved uninstalling a copy of Office XP and replacing it with a copy of Office 2003. Now when I open Outlook, it makes me choose a user. This wasn't in the .pst file which was transferred for the other computer, but apparenly it was on this computer someplace. How can I get Outlook to simply open for the one account without that dialog box popping up? Aloha Annie, Control Panel | Mail | Show Profiles...remove any profiles you don't want. Select the one you do want and set it as the default. (if there are more than one left) -Ben-...

PA Misc. Log Tables
Hi, How can I find the difference between Billed and Un-billed Miscelleneous Logs? Where Can I see Un-billed Misc. Logs and which tables. Hari I have a spreadsheet with the PA tables listed in it. Send an email message to charles.zarzour@intergraph.com and I will send you the spreadsheet. I do an excel spreadsheet for each Dictionary. Makes it easy to lookup tables. "Hari" wrote: > Hi, > How can I find the difference between Billed and Un-billed Miscelleneous > Logs? > Where Can I see Un-billed Misc. Logs and which tables. > > Hari > > Can I ...

crm 3.0 error 03-01-06
Hello, I'me getting this error while installing crm3.0 for SBS: "error writing to file microsoft.mshtml.dll verify that you have access to that directory" That file is in the C:\Program Files\Microsoft.NET\Primary Interop Assemblies directory. I (and 'everyone') has full access to that dir. What can I do about this?? kind regards, Thomas ...

Error in Outlook Today
Whenever I go to Outlook Today, I get a runtime error, line: 297 Error: Class Not Registered. Then I get the error two more times when I click 'Customize Outlook Today...' and the list 'Show Outlook Today In This Style' is empty, and the box under it has a broken image icon. What could be the cause of this? Sorry...forgot to say...I'm using Outlook 2003 Student and Teacher Edition on Windows XP. >-----Original Message----- >Whenever I go to Outlook Today, I get a runtime error, >line: 297 Error: Class Not Registered. Then I get the >error two more time...

Multiple Simultaneous Outlook Sessions
Is there a way for Outlook 2007 or 2003 to have multiple Simultaneous Outlook Sessions open at one time? If so, how is it setup to send and receive from the same profile I would choose and save the replies back into the same profile? thx "Art" <Art@discussions.microsoft.com> wrote in message news:433A0AAA-9DB0-4411-954F-5165374B049D@microsoft.com... > Is there a way for Outlook 2007 or 2003 to have multiple Simultaneous > Outlook > Sessions open at one time? If so, how is it setup to send and receive from > the same profile I would choose and sa...

Re: 'Uknown Error 0x800CCC97'
I just heard back from the folks with whom I filed this bug. They say the bug is fixed in cppop 5.4 - request that your ISP upgrade to that. -- Jeff Stephenson Outlook Development This posting is provided "AS IS" with no warranties, and confers no rights "Jeff Stephenson [MSFT]" <stephenson@online.microsoft.com> wrote in message news:... > See the attached reply to another similar question. Your ISP's POP3 server > has a bug, and they should get a fixed version of the server. > > -- > Jeff Stephenson > Outlook Development > This posting...

stop error defeating me
Hi, XP Pro PC. When I start the computer I can start in safe mode but when I try to start in normal mode it loads to the log on screen. I type the username and password in then it starts to load but stops after a few moments with a blue screen. The error is Stop: c000021a (fatal system error) The windows subsystem system process terminated unexpectedly with a status of 0xc0000005 (0x7c9106c3 0x0055f36c). Begininning dump of physical memory. I have uninstalled AVG, also taken out the graphics card and uninstalled all the drivers for it. I have also changed the RAM. I have also d...

Error in database....
A user posted a batch in payables management. After posting, there was an error encountered. It displays that the table updating was interrupted, use batch recovery to continue the posting. But when I used the batch recovery, it was not successful to continue the update process. When I click the "More Details" button it displays, A save operation on table 'PM_Transaction_WORK' caused a sharing error. How can I resolve this issue? Thanks, John John, it is a db sharing violation. Have all users logout DELETE tempdb..DEX_LOCK DELETE tempd..DEX_SESSION DELETE dynami...

error 553
The following error occurs when sending email from my business domain. It does not occur when sending through my roadrunner account. The following recipient(s) could not be reached: on 10/22/2003 2:05 PM 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) What does this mean and how can it be fixed? ...

80070005 error #2
I am getting this error when trying to view public folder property from system manager. My issue is same as what you can find out from http://forums.msexchange.org/ultimatebb.cgi? ubb=get_topic;f=19;t=000114 Anyone has a clue? ...

unable to grant existing user access to TEST company
Set up test company using live company data; ran the script referenced in CustomerSource article ID#871973; can grant and remove user access in all other companies; ran grantsql 9.2; the dexsql log shows the user already has access probably because of using the other company data for the test; I can set up a new user and grant them access, existing users who already have access can view the company...but, I cannot figure out how to grant access to the TEST company to an existing user. The error popup reads "The user could not be added to one or more databases." Dynamics 9.0,...

How export all mailbox-enabled users from the GAL using Outlook?
Hello, We have a user which, for administrative reasons, needs to export all mailbox-enabled users in the GAL now and then. They just need all the names. Is there a straightforward way for them to do that? We don't want to give them any special permissions and want to avoid server scripting. Ideally, they should be able to export it to a CSV file or any text file. Thanks, - Alan. Alan wrote: > We have a user which, for administrative reasons, needs to export all > mailbox-enabled users in the GAL now and then. They just need all the > names. Is there a straightforward way fo...

Re-enabled user account cannot log in
In trying to troubleshoot and issue in CRM where I had multiple user accounts for a single ADUC user, I tried disabling and re-enabling a user's account. But even after re-enabling the account the user cannot log in now. The error message says that it is disallowed when he tries to browse to the CRM server. Please help, I need to get this user account working again asap. Joel ...

Accessing another user's calendar OL2000/OL2003/Ex2000
Here's the situation: Running Exchange2000, v 6.0, sp4. Users are on XP/OL2003 or NT/OL2000. (we're in the process of upgrading all of the workstations to XP.) VIP user is on XP/OL2003. He can access his calendar just fine on his workstation. His secretary and other office admin type people are still on NT/OL2000. They have reviewer or editor rights to his calendar. They try to access his calendar by chosing File/Open/Other User's Folder... and put in his name and calendar. When they do this, the process hangs. In Task Manager, Outlook is "Running." End the Outloo...

CRM Error
Hello When a user replies to an CRM email, clicks the "reply" button or the "reply all" button, clicks in the body of the email message and clicks "insert template", this error appears. This does not happen every time, and happens to various users. Does anyone know why we would get this error? ...

smtp authentification errors
Hello, I just installed Exchange 2003. It all works fine. I=B4m now=20 retrieving the emails via pop-con and pop3. However I=20 cannot send any authenticicated emails, because the=20 exchange server sends a wrong authentification account to=20 the mail provider, despite the fact, that the right one to=20 be used is enterd. The mail provider tells me that he recives a smtp call,=20 but it=B4s aborted by his server. We do not have a static IP but a dynamic IP, that changes=20 every 24 hours. If a messages is sent to an existing hotmail account the=20 following error message is displayed in the ...

OWA user can only see subject
Hello friends, OWA users are unable to see their mail. Only Subject field is visible, without mail contents(No message is visible). Our outlook is working fine. Any ideas why this is happening and how we can solve this. Regards Guri ...

#error in the calculated field
Hello, I locked the data entered for some users, because their role is just to input the date of invoice for approval by Prj.Manager. My qeustion is, is it the reason we see the "# error" in the VAT checking field??. I tried to ck formula in the qrid query, nothing wrong Thanks for your explanation -- H. Frank Situmorang On Tue, 15 Jan 2008 23:33:01 -0800, Frank Situmorang <hfsitumo2001@yahoo.com> wrote: >Hello, > >I locked the data entered for some users, because their role is just to >input the date of invoice for approval by Prj.Manager. > >My q...

Error when changing average perpetual
I Have the following error in Microsoft Dynamics GP on the screen of average perpetual "Message #10577 Missing" somebody knows about this??? Thank�s. Gabriela Martinez. ...

How to export users list from MS-Exchange AD Users&Computers?
Hello, I want to export my exchange mailbox-enabled users list with their Given Name+Surname and e-mail address.. I get this kind of list from ActiveDirectory Users&Computers but I can not export it.. I know that there is a program somewhere that does what I want, but I can't remember it's name.. Note: I don't mean LDIFDE tools.. Thanks for your help. Capricorn As always...be careful and test things in a lab first, please. LDIFDE tools can be pretty ugly... CSVDE will work and it is possible to limit the columns that are output by CSVDE. Note: If you have a large ...

Adding user / deployment manager
This is a multi-part message in MIME format. ------=_NextPart_000_00F2_01C59850.B067B780 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Can anyone help with this error I'm getting, so far installed software = on server and then get this The server localhost is not responding. this might happen if it is = currently unavailable, it is not a Microsoft CRM server, or you do not = have specific privileges to run user manager. for more information = contact your system administrator. Never used this package before and want to give it a t...

Outlook MAPI (WMS idle error message while shutting down)
I am loading the mapi32/mapisp32 dll in my program. When I shut down while my program is still running, I am getting "WMS Idle" message. 1. While shutting down, why i am not getting 'fnevCriticalError' notification in my IMAPIAdviseSink class?? and 2. What exactly is causing the WMS Idle message ? Any help will be appreciated... ...

Reports with User Date ranges
I'm trying to modify SOP activity reports to print with the restriction of the User Date - not the Document Date. I can't find this field or range. Is there a way I can get any SOP activity report to print the activity for the USER DATE I specify? Thanks. What is the "user date?" I'm not aware of a field with that name. Are you talking about a user-defined field or some other date field? If so, you will need to create your own report; use SmartList; or use Dexterity to modify the selections. "Sal" <anonymous@discussions.microsoft.com> wrote in m...

Excel.Range.Name gives error an exception
Hi All, I am trying to execute below code but it gives me an COMException ///// Code Start //// public string GetName(Excel.Range range) { try { if (range.Name != null) { Excel.Name name = range.Name as Name; if (name.Name != null || name.Name.Length != 0) { return name.Name; } return string.Empty; } return string.Empty; } catch(Exception e) { return string.Empty; } } ///// Code End //// Now every time my very third line "if (range.Name != null)" gives me Exception an except...