Home > Back-end >  Several documents to open multiple tables in a database
Several documents to open multiple tables in a database

Time:09-27

Open multiple tables in a database in the form of multiple documents (TPageControl each page shows a table), build a common filter for multiple tables, can change event in TPageControl TPageControl page tables in the current information to filter, filter, how do I know which one is for table filter?

CodePudding user response:

Don't think so complicated, no matter which table the filter input box, there can be only one still in focus state, in a nutshell,
1, join each TAB has a conditional input box
Put all the dataset onfilterrecord events function point to a function, and then in the function similar to write like this:

//retrieve the currently active input box
//there are multiple ways of obtaining, can use the name of law such as the Angle of the sheet1 edit1, called edit2 sheet2,
//that can be used to find parameters' edit + inttostr (tpagecontrl. Activesheet. Index) to combine the
Edit:=self findcontrol (' * *);
//to the current dataset with keywords and key fields match
Accpet:=pos (trim (edit) the text), and the dataset. Fieldbyname (' field name). Asstring) are identical & gt; Zero,

CodePudding user response:

Onfilterrecord process itself has a dataset parameter, this parameter is the current dataset needs to be filtered, if it is multiple, no need to worry about you which one it is, as long as the proper accept return can, need to be aware of is that if each table is not the same as the field name need to do some processing, but if you don't even like field types, multiple dataset with a filter is basically do not have what meaning,
  • Related