Validation Module DBSEARCH

Purpose:

Search external database and display a Pick List Grid if an exact match cannot be found, and optionally, replace data once a selection from the Pick List Grid has been made.

Usage:

DBSEARCH("dbfname","alias","index","extfield","prompt","desfield")

  • dbfname is the absolute or relative [from Image-Master home] path to the dBase 3,4, or FoxPro database to be searched enclosed in quotation marks as indicated above.

  • alias is a user defined alias used to reference the searched database on subsequent calls. If an alias is specified, the system will not close the database upon exiting the function. If no alias is specified ("") then the database WILL be closed after the function terminates.

  • index is a REQUIRED index TAG or filename. (see below) "TAG tagname": The tag "tagname" will be selected from the structural CDX associated with the database. "indexname": The absolute/relative (as in dbfname) path to a corresponding .NDX or .IDX index file.

  • extfield is the name of the field in the external database that the Pick List will display, and ultimately the value that will be assigned to desfield once a selection from the Pick List has been made.

  • prompt is column title for the Pick List.

  • desfield is the name of the Data Entry Field (including the mandatory prefix "m1").

Operation:

The external database is searched by the specified index using the value in desfield.

  • If an exact match is found, no Pick List is displayed, desfield is left unchanged, and the cursor is moved to the next field in the Data Entry Screen.

  • If an exact match cannot be found, a Pick List is displayed with the selection bar highlighting the nearest match. Once a selection from the Pick List is made, desfield is updated with the selected value from the Pick List. The cursor is moved to the next field in the Data Entry Screen.

  • If a Pick List is displayed, but is closed without a selection being made (by pressing [Escape]), then the Pick List is closed, desfield is left unchanged, and the cursor remains in the field being edited.

Related Topic

Validation Modules Introduction