Input()
Opens a database found in your CAPITAL company directory and presents a look-up box that allows users to search through the database.
Syntax
LookUp(<cTable>, [<nPasteFrom>], [<nSort>], [<cTitle>], [<cScope>] ) --> xData
Arguments
<cTable> --> The name of the database table to open.
<nPasteFrom> --> The column number to paste from.
<nSort> --> The default sorting order to present the table in.
<cTitle> --> The heading to appear at the top of the look-up box.
<cScope> --> The scope (range) of the look-up box's contents.
Returns
This function returns the selected data element specified by the nPasteFrom column or FALSE if nothing was selected.
Description
This function will open any available database table and allow a user to search it. It will also return the selected data element from the table if applicable.
The presented table will be displayed as a series of rows and columns. <nPasteFrom> indicates the column number that any pasted data will be extracted from.
Use <nSort> to control the current sort (presentation) order of the data in the table. This parameter will only apply if the table being opened has been sorted at least once.
A <cScope> may optionally be specified and this must correspond to the sort order. For example, if the table is sorted by name, the scope could be specified as "A", in which case only names beginning with "A" would be included on the list. The scope may only be applied to the selected sort order and must match the sort order type. In other words, if the sort order is numeric then the scope must also be numeric, otherwise a data type error will be reported by the system. Scopes should be applied to fields that are sorted in ascending sequence.
Example
This script code accesses the table REGO when the button next to the field "Rego" is pressed:
LookUp("Rego")
____________________________
Related Topics: