How to Search ? HELP PLEASE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yamasassy
    New Member
    • Mar 2008
    • 15

    How to Search ? HELP PLEASE

    Hi
    basically i got a program in VB6 that can read in and store information on employees and it can read these back out to a set up form , i have navigation buttons
    but i need a search feature and a way to show this on screen, how wouldi go about this , i dont really have a clue been looking but not found any thing , also how do i print the whole txt file and then the information searched i know it had so to with the

    Print . function
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    Originally posted by Yamasassy
    Hi
    basically i got a program in VB6 that can read in and store information on employees and it can read these back out to a set up form , i have navigation buttons
    but i need a search feature and a way to show this on screen, how wouldi go about this , i dont really have a clue been looking but not found any thing , also how do i print the whole txt file and then the information searched i know it had so to with the

    Print . function

    You said the program reads in information.

    In order to do a search you would just have to read in the same information except using the parameter entered in a search text box for your SQL.

    Then re-populate the Recordset you are using to read in now with this filtered data.

    I assume this makes sense? Are you using SQL or are you binding the form to a data control? If you are you can adjust the SQL of that specific data control to be filtered too.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by jeffstl
      ...I assume this makes sense? Are you using SQL or are you binding the form to a data control?
      My guess would be neither. If you look closely, I think the original post says the info is being stored in a text file.

      Or have I got that backwards, Yamasassy?

      Comment

      • gobblegob
        New Member
        • Dec 2007
        • 133

        #4
        hi ,
        If you are loading the text you want to search into a textbox you can use this...

        [CODE=vb]Private Sub Command1_Click( )
        Dim Search, Where
        ' Get search string from user.
        Search = Text2.Text
        ' Find string in text.
        Where = InStr(Text1.Tex t, Search)
        If Where Then
        Text1.SetFocus
        Text1.SelStart = Where - 1
        Text1.SelLength = Len(Search)
        Else
        MsgBox "String not found."
        End If
        End Sub[/CODE]

        GobbleGob.

        Comment

        • Yamasassy
          New Member
          • Mar 2008
          • 15

          #5
          Originally posted by Killer42
          My guess would be neither. If you look closely, I think the original post says the info is being stored in a text file.

          Or have I got that backwards, Yamasassy?
          yeah the info is being saved in to a text file ,
          yamasassy

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            You want to search and navigate the record from a text file ?

            Comment

            • Yamasassy
              New Member
              • Mar 2008
              • 15

              #7
              Originally posted by debasisdas
              You want to search and navigate the record from a text file ?
              i got that navigate bit working , just really confused about how to search

              i have my text file set up going accross the screen insted of down
              Yamasassy

              Comment

              Working...