Results 1 to 2 of 2

Thread: Data Searching with Input Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    6

    Question Data Searching with Input Box

    Dear friends, I have tried so many times to search the data with input box
    but i can't.

    I have created a button "Search by Name". Now i want when we click on the button an input box appear and ask for the name. after giving the name it should be dispplayed in MSFLexgrid b'coz it is possible that there should me more than one employee with the same name. is it possible to search by giving first few characters and searching the data?

    Also when i want to put a code which displays all data from selected department or designation. kindly give the code.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: Data Searching with Input Box

    Thread moved from the FAQ forum, which is not the place to post your questions.

    You can use the InputBox to get a string from the user... see the help on it for an example of how to do that.

    To see if one string is contained within another, you can use the InStr function, eg:
    Code:
    If InStr("A long string", "long") Then
      MsgBox "found 'long' in 'A long string' "
    End If
    As you want to search a MSFlexGrid, use the TextMatrix property to read from the cells, eg:
    Code:
    If InStr(MSFlexGrid1(RowNum,ColNum), strInput) Then
    If you put a loop around this, you can search all rows and/or columns.

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