Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop On Timer Event

Status
Not open for further replies.
Oct 28, 2003
50
MY
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

'
'
'
'
 
How are ya cenderawasih . . . . .

Set the [blue]Timer Interval[/blue] to zero when your condition is met.

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top