After your helpful post #4 I thought that I'd grasped how to make the tree control work the way I wanted but for some reason I'm still having problems
This is the snippet of code I'm struggling with...
Code:
Sub UpdateInbox
TreeViewInbox.RemoveAllNodes
For MSG = 0 To TBLSMSInbox.RowCount-1
If TblSMSInbox.Cell( "READ" , MSG ) = False Then
TreeViewNode1.Value = TreeViewInbox.AddNewNode( TblSMSInbox.Cell( "FROM" , MSG ) & " -- " & Time( TblSMSInbox.Cell( "DATE" , MSG ) ) & " , " & Date( TblSMSInbox.Cell( "DATE" , MSG ) ) )
TreeViewNode2.Value = TreeViewNode1.AddNewNode( TblSMSInbox.Cell( "BODY" , MSG ) )
TreeViewInbox.ImageIndex = 0
TreeViewInbox.SelectedImageIndex = 0
Else
TreeViewNode1.Value = TreeViewInbox.AddNewNode( TblSMSInbox.Cell( "FROM" , MSG ) & " -- " & Time( TblSMSInbox.Cell( "DATE" , MSG ) ) & " , " & Date( TblSMSInbox.Cell( "DATE" , MSG ) ) )
TreeViewNode2.Value = TreeViewNode1.AddNewNode( TblSMSInbox.Cell( "BODY" , MSG ) )
TreeViewInbox.ImageIndex = 1
TreeViewInbox.SelectedImageIndex = 1
End If
Next
TreeViewInbox.ExpandAll
End Sub
When the READ column is True, then the tree view should display image 1, but it doesn't, it continues to show image 0.
I've checked that the Else block of code is being used my inserting a MsgBox in there and I've double checked that image 1 is working by changing the other image 0 commands.
For some reason I just cannot get the tree view to loop through my table and display an image the depicts whether the message has been read or not.
Am I just being really thick today???
Regards,
RandomCoder