Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With a Search for Data

Status
Not open for further replies.

gordy2996

Programmer
Jun 24, 2003
5
CA
I have a database of information. I have created a form that's function is to scan through a selected column for a matching result and then return all the values on the same row. My intentions are to have the data placed into the matching textbox on the form. If I test this using the exact value it works but when I try having it search the entire column it will not work. Does anyone know how I can make this work. Please help me!
 
I really do need the form because AutoFilter isn't quite the format i'm looking for, so if you could tell me how to do it using a form that would be great. Thanks.
 
If MyVal is the test value then...
Code:
ptr = application,match(MyVal,LookupRange,0)
if not iserror(ptr) then
   'got a hit
   for i = 1 to LastCol
      select case i
      case 1
         Textbox1.value = Range("LookupRange")(ptr,i)
      case 2
         Textbox2.value = Range("LookupRange")(ptr,i)
      
      end select
      
   next
end if


Skip,
Skip@TheOfficeExperts.com
 
That didn't work, I entered the search value and no results were transfered to the textboxes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top