>Hi Philip,
>
>Thanks very much for your reply, but I dont understand what is "In a sub for the form that contains the control".. would you please guild me in more detail?
>
>Jimi
>
Hi Jimi,
Sorry for the late reply. I missed your post...
By "sub on the form" I mean from within any code on the form. For example, in VFP, say you had a form that had a textbox called txtText and a button called cmdButton. To reference the value of the textbox in the button's code, you'd have to do something like:
THIS.Parent.txtText.Value
or perhaps
THISFORM.txtText.Value
In VB, it is different. Every object has to have a unique name, and VB enforces this. For example, you cannot have 2 textboxes on the same form, both called txtText, unless it is a control array, in which case you'd use txtText(0) for one, and txtText(1) for the other. The individual object names are still unique.
To reference the textbox value from the button on the VB form, or from anywhere else in the VB form code for that matter, you'd simply use:
txtText.Text
You do not use full object hierarchy (THIS.Parent.. etc.)
HTH,