New

Takes two parameters, TableName, IfLenFld

Description:

The command creates a new Record in the Database for each Record in the Work Query. There must be one Field in the Work Query named TableName.Alias; such as if creating a new Record in the MemTab.Person table, there must be a MemTab.Person.Alias Field in the Work Query.

If the value of the .Alias Field in the Work Query is a * then the Database will set the Alias of the new Record to an auto-number, using the number stored in the Next= Attribute of the Table’s Alias Field. If the value of the .Alias Field in the Work Query has any other value, that value will be used as the Alias for the new Record. The Alias must be unique in the Database Table, and may not contain any spaces. If the .Alias Field in the Work Query is blank it will be skipped without error.

If there are any other Fields in the Work Query that start with the Table Name where the name matches that of the Database Tables’ Fields, then that Field’s data will be included in the New Record. Any Fields that exist in the Table but do not exist in the Work Query will be created as blank.

If an error occurs during the execution of this command on one or more Records, the error message will be placed into a Field in the Work Query named Error. The Field named Error will be created automatically if needed and it does not already exist.

Usage:

TableName, IfLenFld
TableName, [""]
[WorkWith], [""]
TableName, [WorkIf]
[WorkWith], [WorkIf]