I have a gadget that acts like a calculator. I would like to be able to pass a value from the gadget to a field on the form.
If I try "fldIN.text = CalcValue" fldIN is undeclared when I try to compile
If I try "mainForm.fldIN.text = CalcValue" mainForm is undeclared when I try to compile.

As the gadget is part of the form, you can access the proprieties of your gadget from the form.

the second possibilty is to have a global in your form. As the gadget is linked to your form, you have access to the globals of the form, where your gadget will store the result. This second option is not good at all, cause you need a global each time you use your gadget.

Marc:
Thanks. I thought of those possibilities. However neither do what I want. Both have the form getting the value from the gadget (or global). What I want is to select an area in the gadget, and have that populate the field in the form. So instead of the form controlling it, I want the gadget to control it.
John

Marc:
Once again thank you.
Now if I can just get it to work!
I follow the logic, and entered your code. It worked fine.
The function affiche receives the values from the gadget, and the alert displays them. Right?
So what I did was added fldOut and lblOut, and after the alert I added:
fldOut.text = posX + " " + posY;
lblOut.text = posX + " " + posY;

However wnhen I run it I get nothing in the two fields!!

So I thought to myself Self isolate it, so I now have the following code:

The alert in Displayit does display the data correctly, so the x and y variables are being populated correctly.
The fields, however still show nothing.
I do not know what I am doing wrong, but it is frustrating. It is probably something obvious, and simple. I can't see the forest for the trees.
John