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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search in Databound fields

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi:

I have a form bound to a SQL database and have used the navbar that scrolls through the recordset(first, next, previous, last) and I also have add and update buttons working. Each record has a unique id that is auto populated and all I am looking to do is be able to search by Id# and have it bring up the record to the bound fields. Any info on this would be greatly appreciated.
Thanks
 
Firstly add a Search For: input box to the form with a 'Search' button. When the button is clicked you can...

** Adjust the Recordset SQL (or pass a parameter to the SQL) to 'filter' the recordset - only matching item(s) will be displayed. I do not think that you want this though...

OR

** Search through the recordset for a match and position the current row. This can be preformed in two ways - firstly by reading the recordset row-by-row until a match is found, or by using the ADO find method. Unfortunately, this method is hidden behind the RECORSDET.ASP 'layer'. You can edit this file to expose a find method - but it can be a bit intimidating at first.

If the page does not have a grid, then that is all you need to do. A grid can cause problems as it stores its own 'current' position - and it sets this when it 'displays' the grid (ie generates the table HTML). So you just need to be careful when and how you try to set the current row! (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top