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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error

Status
Not open for further replies.

lpgagirl

Technical User
Feb 3, 2003
202
CA
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
 
Check the reference for the FileSystemObject. It might have been removed.
Vince
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top