PDA

Click to See Complete Forum and Search --> : Search


greysquirl
Oct 30th, 2000, 03:15 PM
How do I create a search routine? ? ?

What I want to be able to do is have a text box that you can type an employee's name in to (possibly have it autofill as they type the name) and when it finds a match in the text box (lost_focus) it will insert the employee's full information into the rest of the form.

P.S.W.
Oct 30th, 2000, 11:45 PM
Well, I can't figure out all the code for you, but to get you started, you can look at the Forms 2.0 ComboBox as an entry device for the person's name. I suggest using the Forms 2.0 version because it has an "automatch" feature that will fill-in the name as you type.

I assume you're linking to a database which has all the records, so you just need to link up the ComboBox to your recordset (through the .DataSource or by populating it manually), and you're halfway there (You can set the .MatchRequired property to True to recognize only names in the list).

To insert in the rest of the info, you can either build a SQL statement that uses the entered name as a WHERE parameter, or, look up the .Find method in the VB Help and use that to move to the appropriate record.