Equinox Online Help - Language Reference - A to Z

Home

LookupWrite

Applies to
SyntaxLookupWrite ValueExpression, FieldName [, SearchExpression, IndexName] [, operator, LimitfieldName]
Action[Statement] Writes a field value to a record in an unrelated table.
ScopeUsable anywhere.
Notes

This statement is similar to the Lookup function in that it uses SearchExpression, IndexName, operator and LimitfieldName to locate a record in a remote table. Rather than reading the value from the remote record, this statement writes a new value into the specified field (FieldName). ValueExpression supplies the new field value.

Note that you cannot use this statement to write a picture field value.

After the statement is executed, the SysError system workarea may take one of the following values:

  • 0 The statement was executed successfully.
  • 1 An error occurred.
  • 2 The record is locked by another user.
CategoryRecord location
See Also CountRecords, CurrentTableName, FindRecord, FindRecordLock, GroupFindRecord, IsLookup, IsRecord, IsSameRecord, Lookup, SameRecord
Example

This example uses the Lookup and LookupWrite statements to update a stock field in another table.

number qty

block
qty = Lookup(QtyInStock,partno, iPartno) - QtyOrdered
if syserror then exit block
...
LookupWrite qty, QtyInStock, partno, iPartno
end block

if syserror then
Alert "Unable To access stock quantity For " & partno, 4
Exit Method
end if