cenderawasih
MIS
Hi All....
I have a system which record test sessions. I need to automatically CLOSE the test session if the date for that particular test session is equal to today's date and the time is 9.00 am and above. So...I put the code in the On Timer Event for the Sign On Screen so that when the user log into the system this code will runs until it reached the end of files for the test session table.
When It has read all records AFTER 9.00 am......I want my system to stop running this On Timer event....meaning...I only wants this code to run until it reaches 9.00 am (If the user starts the system after 9.00 am then this code will run only once).
The reason I need to do this is because to save memory usage for my system and I don't think it's good to be running a code that is not necessary....
Please help...this is my code to CLOSE the test session..
Private Sub Form_Timer()
'
'
'
'
rstFPS1TD00.MoveFirst
Do While Not rstFPS1TD00.EOF
If rstFPS1TD00!DSTDAT = intDate Then
If Me.txtclock.Value >= 9# Then
rstFPS1TD00.Edit
rstFPS1TD00!DSTAS = "C "
rstFPS1TD00.Update
If rstFPS1TD00.EOF Then
DoCmd.Close acForm, "FrmSignIn"
'Exit Sub
End If
End If
End If
rstFPS1TD00.MoveNext
Loop
'
'
'
'
I have a system which record test sessions. I need to automatically CLOSE the test session if the date for that particular test session is equal to today's date and the time is 9.00 am and above. So...I put the code in the On Timer Event for the Sign On Screen so that when the user log into the system this code will runs until it reached the end of files for the test session table.
When It has read all records AFTER 9.00 am......I want my system to stop running this On Timer event....meaning...I only wants this code to run until it reaches 9.00 am (If the user starts the system after 9.00 am then this code will run only once).
The reason I need to do this is because to save memory usage for my system and I don't think it's good to be running a code that is not necessary....
Please help...this is my code to CLOSE the test session..
Private Sub Form_Timer()
'
'
'
'
rstFPS1TD00.MoveFirst
Do While Not rstFPS1TD00.EOF
If rstFPS1TD00!DSTDAT = intDate Then
If Me.txtclock.Value >= 9# Then
rstFPS1TD00.Edit
rstFPS1TD00!DSTAS = "C "
rstFPS1TD00.Update
If rstFPS1TD00.EOF Then
DoCmd.Close acForm, "FrmSignIn"
'Exit Sub
End If
End If
End If
rstFPS1TD00.MoveNext
Loop
'
'
'
'