>Now, I am facing 2 problems.
>How can I write an intelligent ON KEY LABEL command in my main form, which will pass the proper parameter from any textbox to this form?
>How can I update the textbox in the calling form with the value selected from the lookup form?
The Container with the lookup field, which you place on each form, should be designed as a class. This allows you to make certain changes only once.
Instead of ON KEY, intercept KeyPress. For instance, the framework I use intercepts the F9 key.
#DEFINE KEY_F9 -8
LPARAMETERS nKeyCode, nShiftAltCtrl
DODEFAULT(nkeycode,nshiftaltctrl)
IF nkeycode = key_f9 AND nshiftaltctrl = 0
NODEFAULT
ENDIF
For the key codes, see HELP INKEY().
As to the second question, you call a modal form like this:
do form SelectFromList with <value> to <returnvalue>
is the parameter you pass; is a value to which the value is returned.
The form returns a value in its .Unload() Event. Pressumably, this value has to be stored in a property first.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)