/ Published in: Visual Basic
Takes place in 3 different forms: Entry Form, KeepOpen, and ForceOut
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Private Sub Form_Load() DoCmd.OpenForm "frmKeepOpen", acNormal, , , , acHidden Forms!frmKeepOpen!ForceOutCheck.Value = "" If DCount("*", "tblForceOut", "[Force Out?] = 'Y'") = 1 Then DoCmd.Quit End If End Sub Private Sub Form_Load() Me.TimerInterval = 300000 End Sub Private Sub Form_Timer() If DCount("*", "tblForceOut", "[Force Out?] = 'Y'") = 1 And Forms!frmKeepOpen!ForceOutCheck.Value = "Y" Then DoCmd.Quit ElseIf DCount("*", "tblForceOut", "[Force Out?] = 'Y'") = 1 Then DoCmd.OpenForm "frmForceOut", acNormal, , , acFormReadOnly, acWindowNormal Me.TimerInterval = 60000 End If End Sub Private Sub Form_Load() Forms!frmKeepOpen!ForceOutCheck.Value = "Y" End Sub