Hello! I’ve got a problem with global variables. Let me first describe the case: I’v got 2 Card-type forms, both linked to the same table. In one of the forms I placed a button. Pushing this button will show the other form. The problem is as followed: When the first form shows the record of e.g. employee_6, and I push the button,the second form appears. However, the second form doesn’t show the record of employee_6. Instead of that it just shows the first record in the table. It should be possible to let the second form show the same record as the first. Since it doesn’t go automatically, I tried to write some code for it. The point is that it is not possible to declare a variable in one form, and use it in an other form. Can annyone help me with this ???
Hi. Set the property “RunFormOnRec” at the button you use. That should do the trick. If you are calling the form from code you can use SetRecAsFilter and call the form with the Form.run(number,rec); Regards Gudmundur Petursson
You could also write a function in one form which sets a global variable— and then you could call it from the other form to pass the variable from one form to the other. ------- Tim Horrigan
Thank you!! Often the solution is just so simple!