Results 1 to 3 of 3

Thread: [RESOLVED] search listbox

  1. #1

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Resolved [RESOLVED] search listbox

    this is what i have

    Dim i As Integer, J As Integer
    Private Sub List1_Click()
    On Error Resume Next
    For J = List1.ListCount - 1 To 0 Step -1
    If InStr(List1.Text, "@yahoo.com") Then
    Me.Caption = "found"
    Else
    Me.Caption = "not"
    End If
    Exit For
    DoEvents
    Next J
    End Sub


    now in my listbox i have email address with and without @yahoo.com

    how do i add line of code in this current code if @yahoo.com isnt found then etc please quick

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: [RESOLVED] search listbox

    Quote Originally Posted by ladoo View Post
    how do i add line of code in this current code if @yahoo.com isnt found then etc please quick
    Then what?

    Code:
    Private Sub List1_Click()
        Dim J As Integer
    
        For J = List1.ListCount - 1 To 0 Step -1
            If InStr(List1.List(J), "@yahoo.com") Then
                Caption = "found"
                Exit For
            Else
                Caption = "not"
            End If
        Next
    End Sub
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: [RESOLVED] search listbox

    thanks bonnie

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