Controlling the focus

I have Form 1 which calls Form 2, and then returns to form 1. I want to control the focus on Form 2, when it is called from form 1, when for example data has not been entered on form 2. For example if Form 2 included Name & address & telephone details. On processing form 1, Address is missing, so I want to call form 2 and focus on the address field, or if telephone is missing I want to call form 2 and focus on the telephone field. This is only relevant when Form 2 is called for the second time. Any ideas appreciated. Thanks.

Create an function in form 2 in which you send a parameter (e.g. an integer) saying which field you want to focus. In “OnOpenForm” of form2, you can put this code (or something like it): CASE IintPutFocus OF 0: BEGIN END; // no focus 1: CurrForm."My Field 1".ACTIVATE; 2: CurrForm."My Field 2".ACTIVATE; 3: CurrForm."My Field 2".ACTIVATE; ... END; In form 1, before calling form 2, you decide which field to focus and run this function.