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

FindNext Emulation

Status
Not open for further replies.

intuitas

Technical User
Apr 21, 2003
11
0
0
AU
I am converting a music database I wrote about six years ago using Access 2 - first to Access 97 then to Access 2000.
One form I have displays a multi-table query recordset sorted on 3 fields say(title, composer and arranger)- I have placed a search button in the header which opens a custom form for the search text and the field to search (including any field). This button works well and the search text is stored in the tag property while the field name is stored in the tag property of my find next button. The find next button code retrieves both search text and field name into local variables. It will happily search and find successive instances but once the last instance is found it does not drop through to the last record in the recordset. I know this is in part because I have had to incorporate both [goto next record] and [goto control(field)] statements before the findnext statement. Visually it is obvious to the user that there are no more instances, but it is untidy (it wasn't in Access 2). When you use the "inbuilt" findnext button it completes the recordset search and returns a search text not found message. One way I could emulate this would be to test the value of the record/control returned by the findnext method but I cannot find any way to reference the current record and control.

Any ideas?
 
Fixed using static variable as a flag for control with focus. Works well!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top