I have a compile timer form that counts down and sounds an alarm when it gets to zero. The form has been working fine for a long time and now out of the blue I am getting a compile error - User-defined type not defined. How can I fix? Here is the code:
Public Sub SoundAlarm(AlarmCount As Integer)
Dim DbRoot As String
Dim ofso As FileSystemObject this is the line - FileSystemObject that it says is the problem
Dim i As Integer
DbRoot = Left$(CodeDb.Name, InStrRev(CodeDb.Name, "\"))
Set ofso = New FileSystemObject
If ofso.FileExists(DbRoot & "themecops.wav") Then
Me.Visible = True
Me.cmdAlarm.Enabled = True
Me.cmdAlarm.SetFocus
For i = 1 To AlarmCount
If bAlarmOn Then
PlayWave (DbRoot & "themecops.wav")
DoEvents
End If
Next i
End If
End Sub
Jeannie
Public Sub SoundAlarm(AlarmCount As Integer)
Dim DbRoot As String
Dim ofso As FileSystemObject this is the line - FileSystemObject that it says is the problem
Dim i As Integer
DbRoot = Left$(CodeDb.Name, InStrRev(CodeDb.Name, "\"))
Set ofso = New FileSystemObject
If ofso.FileExists(DbRoot & "themecops.wav") Then
Me.Visible = True
Me.cmdAlarm.Enabled = True
Me.cmdAlarm.SetFocus
For i = 1 To AlarmCount
If bAlarmOn Then
PlayWave (DbRoot & "themecops.wav")
DoEvents
End If
Next i
End If
End Sub
Jeannie