The return statement returns a value to a field in a different form, which has requested a value.


return expr


expr – The value to be returned to the form that’s requesting a value.


When another form opens the current form using the open statement with the return to field_name clause, a return path is set up, allowing the current form to return a value to a field in the form that opened it. The return statement returns a value to the designated field.

The return statement is used for basic inter-form communication and is useful for designing lookup windows. The return statement is typically used when closing a lookup window, to return the value of the selected field to the specified field in the opening form.

When the return statement is run, the field that is being returned to must become focused for a value to be returned. If a script on the form being returned to has a focus or restart field statement that prevents the focus from moving to the returned field, a value won’t be returned.

Documentation Feedback