On our add/remove/delete records options (they have a navigation bar with prev, next, add, edit, delete and search buttons), we have a generic function that displays a second form (lets call it frmSearch) that allows the user to search records based on different criteria (for example: lets say I’m working with the customers form… I click on the search button and look for all customers whose name starts with ‘B’) . When I find the desired record, I select it from the list and it automatically gets displayed on the parent form (lets call it frmCustomers), because they’re based on the same foundset. This way, I only need to close frmSearch and the desired record will be available for editing. No problem there.
Now, the issue is, whenever the selected record has an index over 200 (lets say the record for customer Bob Jonas has an index of 205), it doesn’t get displayed on the frmCustomers, because, right after the search we execute a foundset.LoadAllRecords (to clear the last search) and that statement loads the first 200 records, so it cant display the selected record 205.
When the user clicks on the search button, I do this:
globals.fSearch("frmSearch",sServerName,sTableName)
forms[globals._sCurrFrmName].foundset.loadAllRecords(); // Ex: Customers form
The fSearch function uses the solution model to show a list of records from the parent table and allows filtering (it uses find/search… it doesnt use addFoundsetFilter) . I know the issue is with the loadAllRecords, but I don’t know how else to ‘clear’ the search I did on the frmSearch , if I dont, it won’t allow me to navigate (prev,next) through all of the customers (in the above example I will only be able to navigate through customers whose name start with ‘B’). The code above works well if the selected record from frmSearch is one of the first 200 records of the customers table.
I hope I wasnt so terrible at explaining myself… Any help is appreciated.
Regards,
jd2p