I have some computers with modems and others without using the same database. They db needs to determine if there is a modem installed. I found code created by KHaled El-Menshawy on the Internet which has the potential to do exactly what I want it to do but I get an "Object required" error. I think this is a simple fix, but I don't know how this object should be declared. Can anyone figure out the missing code? Here is his code:
Public Function CheckModem()
On Error GoTo Errr
If ProgBar.Value = 100 Then
ProgBar.Value = 0
End If
Port = 1
PortinG:
MSComm1.CommPort = Port
MSComm1.PortOpen = True
ProgBar.Value = ProgBar.Value + 20
Label1.Caption = ProgBar.Value & "%"
Form1.MSComm1.Settings = "9600,N,8,1"
MSComm1.Output = "AT" + Chr$(13)
X = 1
Do: DoEvents
X = X + 1
If X = 1000 Then MSComm1.Output = "AT" + Chr$(13)
If X = 2000 Then MSComm1.Output = "AT" + Chr$(13)
If X = 3000 Then MSComm1.Output = "AT" + Chr$(13)
If X = 4000 Then MSComm1.Output = "AT" + Chr$(13)
If X = 5000 Then MSComm1.Output = "AT" + Chr$(13)
If X = 6000 Then MSComm1.Output = "AT" + Chr$(13)
If X = 7000 Then
MSComm1.PortOpen = False
Port = Port + 1
GoTo PortinG:
If MSComm1.CommPort >= 6 Then
Errr:
MsgBox "Can't Find Modem"
GoTo done
End If
End If
Loop Until MSComm1.InBufferCount >= 2
instring = MSComm1.Input
MSComm1.PortOpen = False
ProgBar.Value = 100
Label1.Caption = ProgBar.Value & "%"
Text1.Text = "com" & Port 'MSComm1.CommPort & instring
MsgBox "Modem found On Com" & Port
done:
End Function