Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub cmdLink_Click()
  2.     'Close this window... Save the link... Add to listview in previous window
  3.        'Routine to generate the next available linkID
  4.        ID = 1000
  5.         Open App.Path & "\LinkFile.rnd" For Random As #1 Len = Len(alinksfile)
  6.             While Not EOF(1)
  7.                 Get #1, ID, LinkRecord
  8.                     If LinkRecord.ID = 0 Then
  9.                         ID = ID
  10.                     Else
  11.                         ID = ID + 1
  12.                     End If
  13.             Wend
  14.         Close #1
  15.     End If
  16.        
  17.    
  18.     'Retrieve the selected item from the listview and put it into the file as a new record
  19.        LinkRecord.ID = ID 'comment
  20.        LinkRecord.itemID = ListView1.SelectedItem.ListSubItems 'comment
  21.        LinkRecord.LinkedID = ListView1.SelectedItem.ListSubItems(1) 'comment
  22.    'Add the new item into the listview back in the original item's window
  23.        frmAppointment.ListView1.ListItems(i).ListSubItems.Add , , LinkRecord.ID
  24.         frmAppointment.ListView1.ListItems(i).ListSubItems.Add , , LinkRecord.LinkedID
  25.    
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement