Good day,
Please advise why i'm getting the following error.
380 - Invalid property value
I have the same code on a different form and it works...
Thanks
Please advise why i'm getting the following error.
380 - Invalid property value
I have the same code on a different form and it works...
Thanks
Code:
Private Sub Command2_Click()
Dim mstrSQL As String
Dim list_item As ListItem
On Error GoTo LocalError
mstrSQL = "SELECT *" _
& " FROM CRLog WHERE TRSNum = '" & txtval.Text & "'" _
& " ORDER BY RFSNum desc"
Set mobjADORst = New ADODB.Recordset
mobjADORst.CursorLocation = adUseClient
mobjADORst.Open mstrSQL, mobjADOConn, adOpenDynamic, adLockOptimistic, adCmdText
ListViewGrid.ListItems.Clear
With mobjADORst
Do Until .EOF
Set list_item = ListViewGrid.ListItems.Add(, , !Id & "", , "Search")
list_item.SubItems(1) = !TRSNum & "" 'error occurs here...
.MoveNext
Loop
End With
Exit Sub
LocalError:
MsgBox Err.Number & " - " & Err.Description
End Sub