I am trying to get MSComm based communications routines running in my Access VBA code:
Private Sub Form_Load()
On Error GoTo load_error
Dim MSComm1 As MSComm
' Open the serial port
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
If bolToolsOn Then
Command107.Visible = True
Command31.Visible = True
Command32.Visible = True
Command70.Visible = True
End If
load_exit:
Exit Sub
load_error:
MsgBox Err.Description
Resume load_exit
End Sub
When it runs, I get the above listed error (91) with the MSComm1.CommPort = 1 line highlighted.
Any ideas?
Thanks
Rich
Private Sub Form_Load()
On Error GoTo load_error
Dim MSComm1 As MSComm
' Open the serial port
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.InputLen = 0
MSComm1.PortOpen = True
If bolToolsOn Then
Command107.Visible = True
Command31.Visible = True
Command32.Visible = True
Command70.Visible = True
End If
load_exit:
Exit Sub
load_error:
MsgBox Err.Description
Resume load_exit
End Sub
When it runs, I get the above listed error (91) with the MSComm1.CommPort = 1 line highlighted.
Any ideas?
Thanks
Rich