How do I call multiple items in the same recordset?
Example: I have two different E-mails with two different subjects. They are inside the Sender recordset. I want to load them both into the listview. Here's some code for you to work from.
VB Code:
Private Sub tvwFolders_NodeClick(ByVal Node As MSComctlLib.Node) Set Recordset = New ADODB.Recordset lvwMail.ListItems.Clear If Recordset.State = 0 Then Recordset.Open dtaDeletedMail.RecordSource, dtaDeletedMail.ConnectionString, adOpenKeyset, adLockOptimistic End If If Node.Index = 1 And Node.Expanded Then tvwFolders.Nodes(1).Expanded = False tvwFolders.Nodes(1).Image = 1 Else tvwFolders.Nodes(1).Expanded = True tvwFolders.Nodes(1).Image = 2 End If Select Case Node.text Case "Inbox" If lvwMail.ListItems.Count = 0 Then Call ListMessages End If Case "Trash" If Recordset.EOF = True Or Recordset.BOF = True Then Exit Sub lvwMail.ListItems.Clear With lvwMail.ListItems.Add(, , Recordset!Sender) .SubItems(1) = Recordset!Subject .SubItems(2) = Recordset!Date End With End Select End Sub


Reply With Quote