Experts, I have an activeX.exe that is to keep tabs on the network status of several industrial inkjet printers on a network in a manufacturing environment. I have created a type and array of that type and I need to pass it to the client program in the arguments of an event. I keep getting an error stating "Type Mismatch: array of user defined type expected." Can you please show me what i am missing here. I am sure I have not delared something properly.
Below is some of my code. The error happens in the startComm procedure.
Private Type netComm
ipAddress As String
printerReady As Boolean
Private commStatus() As netComm
Public Sub startComm()
Dim SQL As String, rs As DAO.Recordset, varLoop As Long
printerCount = DCount("IPAddress", "Printers")
'ReDim Preserve ipAddress(printerCount) As String
'ReDim Preserve printerReady(printerCount) As Boolean
ReDim tcp(printerCount) As tcp
'ReDim Preserve printer(2, printerCount) As String
ReDim commStatus(printerCount) As netComm
SQL = "SELECT IPAddress FROM Printers"
Set rs = currentDb.OpenRecordset(SQL)
varLoop = 0
Do While Not rs.EOF
'printerReady(varLoop) = False
'ipAddress(varLoop) = rs.Fields("IPAddress")
'printer(0, varLoop) = rs.Fields("IPAddress")
'printer(1, varLoop) = "Not Ready"
commStatus(varLoop).ipAddress = rs.Fields("IPAddress")
commStatus(varLoop).printerReady = False
Set tcp(varLoop) = New tcp
varLoop = varLoop + 1
Set rs = Nothing
'commTimer.Enabled = True