Results 1 to 6 of 6

Thread: [RESOLVED] Irritating Problem

Threaded View

  1. #1

    Thread Starter
    Addicted Member GedOfEarthsea's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    145

    Resolved [RESOLVED] Irritating Problem

    Hello, I am stuck. I noticed in one of my older programs I have a problem and I wanted to fix it.

    It is a web browser. I added a google search button to it. When the button is pressed I wanted to save the text to file for a history in the google search combobox. That works, however it adds it 5 times each time it is searched! I have no idea why, so today I have tried to make it exit the saving sub if the text is already in there. I keep getting errors or it just keeps doing it. If someone could please help me it would be wonderful, I added the code for the whole command click below.

    VB Code:
    1. Private Sub cmdGoogle_Click()
    2.        For i = 0 To lstBlocked.ListCount + 1
    3.             If UCase(cboSearch.Text) = UCase(lstBlocked.List(i)) Then
    4.                 wb1.Stop
    5.                 MsgBox "The Search Contains A Word That Is In The Block List."
    6.                 wb1.Stop
    7.                 Exit Sub
    8.                 Else: wb1.Navigate ("http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=" & cboSearch)
    9.                                
    10.             ' Save - - Everything Above This Works Great
    11.             Dim X As Integer
    12.             Dim var1 As String
    13.             var1 = cboSearch.Text
    14.             For B = 0 To cboSearch.ListCount + 1
    15.                 If UCase(cboSearch.Text) = UCase(cobsearch.Text(B)) Then
    16.                     Exit Sub
    17.                 Else
    18.                 If var1 = "" Then Exit Sub Else
    19.                 cboSearch.AddItem var1
    20.                 Open App.Path & "\GoogleHistory.dat" For Output As #1
    21.                 For X = 0 To cboSearch.ListCount + 1
    22.                     Print #1, cboSearch.List(X)
    23.                 Next X
    24.                 Close #1
    25.                 End If
    26.         Next i
    27. End Sub
    Last edited by GedOfEarthsea; Sep 2nd, 2006 at 02:28 PM. Reason: spelling errors - lol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width