Results 1 to 7 of 7

Thread: use .Find

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    on Earth
    Posts
    110

    use .Find

    i have a textbox where i type in wut i want to search for named txtSearch ..
    how do i code in the SEarch button so that.. in my data grid, an arrow will be pointed to the value i typed in txtSearch?

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Are you ultimatly going to use that to retrieve a record
    from a DataBase?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    on Earth
    Posts
    110
    i jsut want to know how to do it..
    this is my code for the search button, i want to capture wut the user typed in the textbox and search for that word or number or whatever

    VB Code:
    1. Private Sub searchRes_Click()
    2. With Adodc1.Recordset
    3. .MoveFirst
    4. .Find "[Bus No] = 'txtsearch.text'"
    5. End With
    6. End Sub

    i kept getting error.. but if i replac txtsearch.text with a value, it works.. let's say 231.. my find button works then, cant it capture the word from textbox and find using the word?

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    7
    hi there
    only one mistake u r doing

    Code:
     .find "bus no = " & txtsearch.text 
    this will work definately.

    all the best

    sachin
    Try......try.....and try.....don't give up.....u will suceed...all the best

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    on Earth
    Posts
    110
    wow it's working fine.. figuring it out the whole night
    ****..

    one more question.. now i want to enhance it to two textbox to search..
    the user can either enters something on the first textbox OR the 2nd one.. and the .find will find either one.. or both..

    so how do i code the 2nd input value to the .find?

  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    7
    hi there,
    try using AND keyword ahead of that strinf.
    Code:
    .find "Bus no = " & txtsearch1.text AND & txtsearch2.text
    hey this is just a try.....u play with that ....definately u'll get that.

    all the best

    sachin
    Try......try.....and try.....don't give up.....u will suceed...all the best

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    on Earth
    Posts
    110
    VB Code:
    1. .Find "[Bus No] = " & txtSearch.Text Or "[Schedule No] = " & txtSearch2.Text

    i did that.. and it doesnt work.. type mismatch error..

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