Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 2.46 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Private Sub mnusearch_Click()
  2. Dim search As String
  3. search = InputBox("Enter Name to Search for", "Search")
  4. Dim x As Integer
  5. Dim done As Integer
  6. Dim out As String
  7. Dim list1pos As Integer
  8. Dim list2pos As Integer
  9. Dim list3pos As Integer
  10.  
  11. For x = 0 To lstLosAngeles.ListCount - 1
  12.     If lstLosAngeles.List(x) = search Then
  13.         list1pos = x + 1
  14.         'MsgBox search + " was found in " + Label2.Caption + "(Name #" + Str(x + 1) + ")"
  15.         done = 1
  16.     End If
  17. Next x
  18.  
  19. For x = 0 To lstNewYork.ListCount - 1
  20.     If lstNewYork.List(x) = search Then
  21.         list2pos = x + 1
  22.         'MsgBox search + " was found in " + Label3.Caption + "(Name #" + Str(x + 1) + ")"
  23.         done = 1
  24.     End If
  25. Next x
  26.  
  27. For x = 0 To lstOrlando.ListCount - 1
  28.     If lstOrlando.List(x) = search Then
  29.         list3pos = x + 1
  30.         'MsgBox search + " was found in " + Label6.Caption + "(Name #" + Str(x + 1) + ")"
  31.         done = 1
  32.     End If
  33. Next x
  34.  
  35. If done = 0 Then
  36.     MsgBox "This item was not found"
  37.     Exit Sub
  38. End If
  39.  
  40. If list1pos > 0 And list2pos > 0 And list3pos > 0 Then
  41.     MsgBox search + " was found in: " + vbNewLine + Label2.Caption + "(Name #" + Str(list1pos) + ")" _
  42.     + vbNewLine + Label3.Caption + "(Name #" + Str(list2pos) + ")" _
  43.     + vbNewLine + Label6.Caption + "(Name #" + Str(list3pos) + ")"
  44.     done = 2
  45. End If
  46.  
  47.  
  48. If list1pos > 0 And list2pos > 0 And done <> 2 Then
  49.     MsgBox search + " was found in: " + vbNewLine + Label2.Caption + "(Name #" + Str(list1pos) + ")" _
  50.     + vbNewLine + Label3.Caption + "(Name #" + Str(list2pos) + ")"
  51.     done = 2
  52. End If
  53.  
  54. If list2pos > 0 And list3pos > 0 And done <> 2 Then
  55.     MsgBox search + " was found in: " + vbNewLine + Label3.Caption + "(Name #" + Str(list2pos) + ")" _
  56.     + vbNewLine + Label6.Caption + "(Name #" + Str(list3pos) + ")"
  57.     done = 2
  58. End If
  59.  
  60. If list1pos > 0 And list3pos > 0 And done <> 2 Then
  61.     MsgBox search + " was found in: " + vbNewLine + Label2.Caption + "(Name #" + Str(list1pos) + ")" _
  62.     + vbNewLine + Label6.Caption + "(Name #" + Str(list3pos) + ")"
  63.     done = 2
  64. End If
  65.  
  66. If done <> 2 Then
  67. If list1pos > 0 Then
  68.     MsgBox search + " was found in " + Label2.Caption + "(Name #" + Str(x + 1) + ")"
  69. ElseIf list2pos > 0 Then
  70.     MsgBox search + " was found in " + Label3.Caption + "(Name #" + Str(x + 1) + ")"
  71. ElseIf list3pos > 0 Then
  72.     MsgBox search + " was found in " + Label6.Caption + "(Name #" + Str(x + 1) + ")"
  73. End If
  74. End If
  75.  
  76. done = 0
  77. search = ""
  78.  
  79.  
  80.  
  81. End Sub