Private Sub Form_Load()
DoCmd.OpenForm "Title Page", acNormal
End Sub
Private Sub Form_Timer()
Dim sPath As String
Dim i As Integer
Dim dStartTime As Double
Dim dEndTime As Double
sPath = CurrentProject.Path
With Application.FileSearch
.NewSearch
.LookIn = sPath
.SearchSubFolders = False
.FileName = "DatabaseOn.txt"
.MatchTextExactly = True
.fileType = msoFileTypeAllFiles
If .Execute() > 0 Then
'keep database going
Else
'turn off for maintenance
dStartTime = Timer
MsgBox "This database will be closing for maintenance"
DoCmd.Quit
End If
End With
End Sub
Yes. In the form's Properties (in Design view), go to the Events tab. Near the bottom you will see On Timer and Timer Interval.Would I paste this code in with the code for the form that comes up when the database is launched?
This is the Timer Interval line. Enter the desired interval as I described in my previous post.Also, when I create a form, I don't see a selection for timer properties.
DoCmd.OpenForm "frmMonitor",,,,,acHidden