Need Help (Search Program)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pa2ratczi
    New Member
    • Mar 2007
    • 19

    #1

    Need Help (Search Program)

    Hi there, am having trouble with my program, its a file locator program just like a search engine in a local drive:
    heres wat i have coded:

    Code:
    Private Sub Command1_Click()
    Dim SearchFile As String
    Dim FileName As String
    
    If Drive1.Drive = "c:" Then
        SearchFile = Dir$("C:\*.*")
            While SearchFile <> ""
                List1.AddItem (SearchFile)
                SearchFile = Dir$
            Wend
    End If
    
     
    End Sub
    but only display single file on my drive c:. and it doesnt compare the file that i'am looking for. the output of this code is always the same. Thing is it doesnt look inside a folder.

    So my question is 1.) How i'am able to search a file inside a folder and display it
    2.) How iam able the to look for a specific file in my drive c:, by in-putting a filename in a textbox. i hope u can picture what i'am trying to do.


    Hoping for an immediate help! thank you....
    Last edited by willakawill; Mar 15 '07, 07:09 PM. Reason: please use code tags
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Hi. What is Drive1?

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by willakawill
      Hi. What is Drive1?
      If it's a DriveListBox control, then your If test may miss it. In my case, the .Drive property returns a string containing the drive letter as in your example, followed by the volume name, in the format "c: [xxxxxx]". Testing If "c:" = "c: [xxxxxx]" would certainly not produce a match.

      Have you checked the value?

      Comment

      Working...