importform
ARCHIVE
,
OPTION
,
VALUE

The importform statement imports a form into a database.


Parameters

This statement has three parameters:

archive – is a binary archive containing the form to import. This archive must have been originally created with the exportform( function.

option – one or more options that modify the import. See below for descriptions of each option. The option can be specified in either upper or lower case.

value – is the option value (see below).


Description

This statement imports a form into a database. The form must have been previously saved with the exportform( function. This example copies the form Daily Report from the current database into the Checkbook database.

local transferData
transferData=exportform("Daily Report")
opendatabase "Checkbook"
importform transferData

If the Checkbook database already contained a Daily Report form, it will be updated. If it did not contain a Daily Report form, it will be added.

Note: In addition to the form parameter, you can also specify one or more option/value pairs that modify the import operation, like this:

importform formArchive,option1,value1,option2,value2,option3,value3

NAME

This option specifies the name of the imported form. This example makes a copy of the Data Entry form.

local transferData,formName
formName = "Data Entry"
transferData=exportform(formName)
importform transferData,"Name",formName+" Copy"

If there is no name option, the original name the form had when the exportform( function was used will be used.

DATABASE

This option allows you to specify the database the form will be imported into. You can import the form into any open database. If this option is omitted, the form will be imported into the current database.

importform transferData,"Database",targetDB

INSERTBEFORE

This option allows you to specify the location of the imported form. The imported form will be imported in front of the specified form. This example makes a copy of the Quarterly Report and inserts the copy, which will be named Monthly Report, above the Quarterly Report form.

local transferData,formName
formName = "Quarterly Report"
transferData=exportform(formName)
importform transferData,"Name","Monthly Report","InsertBefore","Quarterly Report"

If there is no insertbefore option, the imported form will be added at the end of the current list of forms (unless it already exists, in which case it will be updated).

UPDATE

If the form to be imported already exists, the importform statement updates the existing form rather than adding a duplicate. If the update option is false, the statement will NOT update the existing form (instead an error message will be generated.). This example copies the form Monthly Analysis from the current database into the Checkbook database, however, if the Monthly Analysis form already exists in the Checkbook database, the program will stop with an error.

local transferData
transferData=exportform("Monthly Analysis")
opendatabase "Checkbook"
importform transferData,"update","false"

CREATE

If the form to be imported does not already exist, the importform statement will create it. However, if the create option is false, the statement will NOT create a new form in the database (instead an error message will be generated.). This example copies the form Monthly Analysis from the current database into the Checkbook database, however, if the Monthly Analysis form does not already exist in the Checkbook database, the program will stop with an error. (If it does exist, it will be updated.)

local transferData
transferData=exportform("Monthly Analysis")
opendatabase "Checkbook"
importform transferData,"create","false"

See Also


History

VersionStatusNotes
10.0NewNew in this version.