Synchronous Communication Between Forms

Please advise if and how the following (steps 4-6) may be accomplished: 1. Think of the Purchases & Payables Requisition Worksheet populated with a list of items. 2. Place the cursor on any item. 3. Click a new, customized button that brings up a new screen (subform) displaying information about that item. 4. This new screen has buttons NEXT and BACK. 5. Click on NEXT to see the next item in the worksheet, without first having to go back to the worksheet and explicitly move to the next item. 6. Continue to use NEXT and BACK to navigate through the list of items without going back to the worksheet. 7. When done, click CLOSE and return to the Worksheet.

Hi Tina, Let’s call the two forms “worksheet” and “subform”. If I understand correctly, there is no connection between worksheet and subform except that all filters currently effective in worksheet have also to be active in subform, effectively pretending that NEXT and BACK seem to navigate through worksheet. So - subform’s source table will be the same as that of worksheet’s items. Upon pressing the button (step 3), you execute some code which transfers the filters from worksheet’s table to subform’s table. This can be accomplished by the following code: In worksheet: VAR sf: FORM subform; sf.SETTABLEVIEW(Rec); sf.RUN; In subform, the two buttons are not really necessary, because the do no more and no less than the standard navigation buttons. If you do need them, just put NEXT and NEXT(-1) in their triggers. Disclaimer: Not tested [;)]

I misstated the situation. The second form is NOT a subform. It is a totally separate form linked to the main form only by an item number. The second form displays details about the current item. Then I want to proceed to the next item, staying in the second form.

Hi, sometimes such discussion are easier if the code is here to read

The simple answer is NO. If you have two separate forms, without one being subform you cannot synchronize them, though another solution can be suggested. You (or your NSC) can, just like Heinz suggested, create form with a subform. Then the master part of the form can be filtered to this exact Req.Worksheet Batch you are looking on and positioned on the exact item of the Requisition Worksheet you were. Then on the subform you can place whatever information you need, and it will be linked to the “master” form. That way when you scroll the master form it’ll be like scrolling through the Req.Worksheet and you’ll have your Item information either.

I knew the second form was not an actual subform but an independent form. However, I do not think that what you are trying to accomplish can be called “synchronization”. Please tell me where I am wrong: You have one form with a certain list of items, and a second form displaying detailed information for each item. Stepping through the second form gives you details only about the items shown in the first form, but not about others. The first form is completely unaware about the user’s navigation through form 2, i.e. the current record is not automatically set to the item currently detailed on form 2. If this is so, then all you are actually doing is navigate through a list of items which happens to show the same records as form 1. In this case, all that needs to be done is copying filters from form 1 to form 2. Right or wrong? [8)]

The first form contains a list of items and a quantity field Item Qty >100 0 200 0 300 0 When the user places the cursor on item 100 and clicks the “X” button, another form is displayed. This second form shows details about item 100 retrieved from various tables throughout the system. From the details gathered, a suggested purchase order quantity is computed and displayed. The user may then click the “Order” button to return that suggested quantity back to the calling form. Or, the user may enter another value, and then click the “Order” button. Item Qty >100 50 200 0 300 0 Then the user must move the cursor to the next item, 200, and click the “X” button again to get back to the second form, which now displays details about item 200. The intent of the “Next” button is to allow the user to “Order” item 100, and then be able to see the details about the next item, 200, without returning to the main list.

My five cents on this “second” form, and in fact Heinz did already propose this solutions… Set the Source Table of your second form to Requisition Line, and do the neccesary operations and data gathering on that second form, that you need to do. When you open the second form, you simply pass over the current record and the filters. There doesn’t need to be done any synchronous communication between the forms, because it’s the same underlying table. When the users wants to change the Order Quantity, simply refer to the standard Quantity field of the Requesition lines. I guess the only point where you have to be careful is to update the first form, when you close the second one… Saludos Nils

Everyone – thank you for your input. We know how to proceed now.