Error adding item to ListView [Resolved]
Hi guys, i'm using a listview for the first time...
this is my code to add to a listview (2 of them)
VB Code:
Private Sub ShowRecordLists()
On Error GoTo ErrorHandler
'goes through each record and adds it to the correct listview
rstCalls.MoveFirst
lvwCompleted.ListItems.Clear
lvwOutstanding.ListItems.Clear
Do Until rstCalls.EOF = True
If rstCalls!booCompleted Then
'ERROR ON LINE BELOW
lvwCompleted.ListItems.Add , rstCalls!txtID, rstCalls!dtmDateLogged & vbTab _
& rstCalls!txtCallerName & vbTab & rstCalls!txtReason
Else
lvwOutstanding.ListItems.Add , rstCalls!txtID, rstCalls!dtmDateLogged & vbTab _
& rstCalls!txtCallerName & vbTab & rstCalls!txtReason
End If
rstCalls.MoveNext
Loop
Exit Sub
ErrorHandler:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure ShowRecordLists of Form frmCallLog"
End Sub
the error is 35603 Invalid Key.
the value of rstCalls!txtID at this point is "000010"
the Key parameter is expecting a string expression and rstCalls!txtID is a text field, so i dont see the problem...:(