In the database management system, the data input is the basic function of the processing, the input operation is convenient or not is one of the indexes of evaluating the interaction of database application. In addition to the input data should be entered into the legal test, should also provide users with more convenient operation, that is, "normative" data, such as: gender, title and other fields of data, should be as far as possible for users to "select" input, rather than direct text entry, in addition, such as: birth date, contact telephone, postcode and other similar names of fields, Program should be set up data entry format, which can be to a certain extent, "standard" data, and improve the speed of input. In addition, in the large amount of data entry, the user also want to more quickly similar data batch input, to achieve efficient data processing. This article only introduces the "batch data" input processing.
For most of the record data to be entered with the existing (that is, entered) data has more or less the same content, therefore, modify the record of a small number of field data is undoubtedly more quickly than the field-by-text input. Because this method originates from the "Set Carry On" command of the Foxbase system, it is named record "carry". The following details the implementation of the "carry" function in this data entry.
Create a dynamic array that holds all the field values for the entire record (excluding types such as Memo type), defined as follows:
Mydynamic_record:variant; Defines a dynamically variable array that holds the field values for the current record
Note that the number of array cells and cell value types are not qualified here, and are more versatile.
In the InsertBefore event of the Table object, the reading of the source data is completed and stored in the dynamic array Mydynamic_record.
Specifically, the user navigates to the record location to be the source (either a final record or a middle record), before inserting with the Insert key (or a key or button provided by another application) Adds code that reads the values of each field in the current record for the InsertBefore event of the Table object (see the following myrecordscatto () Custom function) and is stored in the Mydynamic_record.
Third, write the Mydynamic_record array value to the field values of the new record in the InsertAfter event of the Table object (see the following My_gathfrom custom functions for your code).