Not to worry Albert, I've done it the 'hard way'!
Basically I'm building up my custom ListBox class.
Thanks anyway.
Damien
Public Function ItemExists(item_name) As Boolean
'Confirm if given item exists in first column of ListBox
On Error GoTo ItemExists_Err
Dim i As Long
' Loop thru all items
For i = 0 To mListBox.ListCount - 1
If mListBox.ItemData(i) = item_name Then
ItemExists = True
Exit For
End If
Next
ItemExists_Exit:
Exit Function
ItemExists_Err:
Select Case Err
Case Else
ReportError "clsListBox", "ItemExists", "Error
testing if item exists:", True, False, "ListBox",
mListBox.Name, "Item", item_name
End Select
Resume ItemExists_Exit
End Function
''VB6
'Public Function ItemExists(item_name) As Boolean
'
' Dim lngResult As Long
'
' lngResult = SendMessageFind(mListBox.hWnd,
LB_FINDSTRING, 0, item_name)
'
' If lngResult = LB_ERR Then
' 'Item not found
' Else
' ItemExists = True
' End If
'
'End Function
Private Sub Class_Terminate()
'Set mListBox = Nothing
End Sub