M
Mark A. Sam
I wrote the following procedure to update a table from a form. It is in the
Timer Event.
Private Sub Form_Timer()
[txtTime] = Time
[Users].Requery
[UserActivity].Requery
iCount = iCount + 1
If iCount >= 120 Then '1 hour of time
iCount = 0
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("ScreenUserIdent", dbOpenDynaset,
dbSeeChanges)
rst.FindFirst "[EmpLoginName] = '" & GetLoggedUser & "' And
[MachineName] = '" & fOSMachineName & "' And [FormChildlink] = " & [ordID]
If Not rst.NoMatch Then
rst.Edit
rst![TimeLog] = Time
rst.Update
End If
Set rst = Nothing
End If
End Sub
The event is set for 30000 (30 seconds) to requery subforms. The method to
update the table is set for 1 hour (Icount = 120) , becuase I am afraid of
memory problems. Sometimes during testing I would get a message saying
there is not enough memory to refresh the screen display. However, I am
working remotely via terminal services and am thinking maybe that is the
issue. Last night I set iCount to 4 (two minutes) and upened the screen. I
also attached to my client via PC Anywhere and opened the same screen and
let them both run for a while to see if one had a problem and not the other,
but neither did.
I want to update the table more frequently, but am concerned about the
memory issue.
Can someone tell me if something in my method is inefficnet or can be
improved so that I can update every minute without worrying about memory?
God Bless,
Mark A. Sam
Timer Event.
Private Sub Form_Timer()
[txtTime] = Time
[Users].Requery
[UserActivity].Requery
iCount = iCount + 1
If iCount >= 120 Then '1 hour of time
iCount = 0
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("ScreenUserIdent", dbOpenDynaset,
dbSeeChanges)
rst.FindFirst "[EmpLoginName] = '" & GetLoggedUser & "' And
[MachineName] = '" & fOSMachineName & "' And [FormChildlink] = " & [ordID]
If Not rst.NoMatch Then
rst.Edit
rst![TimeLog] = Time
rst.Update
End If
Set rst = Nothing
End If
End Sub
The event is set for 30000 (30 seconds) to requery subforms. The method to
update the table is set for 1 hour (Icount = 120) , becuase I am afraid of
memory problems. Sometimes during testing I would get a message saying
there is not enough memory to refresh the screen display. However, I am
working remotely via terminal services and am thinking maybe that is the
issue. Last night I set iCount to 4 (two minutes) and upened the screen. I
also attached to my client via PC Anywhere and opened the same screen and
let them both run for a while to see if one had a problem and not the other,
but neither did.
I want to update the table more frequently, but am concerned about the
memory issue.
Can someone tell me if something in my method is inefficnet or can be
improved so that I can update every minute without worrying about memory?
God Bless,
Mark A. Sam