G
Guest
I have been putting together the pieces to shut down an Access application
remotely (Article ID 304408), in which there's a hidden form with code that
starts a countdown for shutdown if a file of a certain name is missing.
I have a button for the DB admin to use to change the name of the file
(UsersOn to UsersOff), to start the shutdown. (This works) What I can't get
working is code in the OnOpen event of the hidden form that automaticallly
renames the file to UsersOn if its name is UsersOff. Here's what I have:
Private Sub Form_Open(Cancel As Integer)
Dim strFileName As String
strFileName = Dir("\\Mvnf02\Csenet\Service Requests Admin\Kickoff
Users\UsersOff.txt")
'Resets text file name to give users uninterrupted access to the database
If strFileName = "\\Mvnf02\Csenet\Service Requests Admin\Kickoff
Users\UsersOff.txt" Then
Name "\\Mvnf02\Csenet\Service Requests Admin\Kickoff Users\UsersOff.txt" _
As "\\Mvnf02\Csenet\Service Requests Admin\Kickoff Users\UsersOn.txt"
End If
' Set Count Down variable to false
' on the initial opening of the form.
boolCountDown = False
The Name...As syntax works on the OnClick event of a button, but did not
"travel well" to this use. Would appreciate suggestions.
remotely (Article ID 304408), in which there's a hidden form with code that
starts a countdown for shutdown if a file of a certain name is missing.
I have a button for the DB admin to use to change the name of the file
(UsersOn to UsersOff), to start the shutdown. (This works) What I can't get
working is code in the OnOpen event of the hidden form that automaticallly
renames the file to UsersOn if its name is UsersOff. Here's what I have:
Private Sub Form_Open(Cancel As Integer)
Dim strFileName As String
strFileName = Dir("\\Mvnf02\Csenet\Service Requests Admin\Kickoff
Users\UsersOff.txt")
'Resets text file name to give users uninterrupted access to the database
If strFileName = "\\Mvnf02\Csenet\Service Requests Admin\Kickoff
Users\UsersOff.txt" Then
Name "\\Mvnf02\Csenet\Service Requests Admin\Kickoff Users\UsersOff.txt" _
As "\\Mvnf02\Csenet\Service Requests Admin\Kickoff Users\UsersOn.txt"
End If
' Set Count Down variable to false
' on the initial opening of the form.
boolCountDown = False
The Name...As syntax works on the OnClick event of a button, but did not
"travel well" to this use. Would appreciate suggestions.