>Hi Bruce and others,
>
>I have moved the searching method into the base form and pass the value to a text box on the base form the execute a method on the form.
>
>The first statement fails and the second one works. In the debug window thisform.ocurrcolumn.controlsource evaluates to "customer.fname"
>
>locate for alltrim(upper(thisform.ocurrcolumn.controlsource)) ;
> = alltrim(upper(thisform.txtfind.value))
>
>locate for alltrim(upper(customer.fname)) ;
> = alltrim(upper(thisform.txtfind.value))
>
>
>For some reason in the locate thisform.courrcolumn.controlsource does not evaluate to "customer.fname"
>
>Any help is welcome
>
>Thanks
You're problem is that the first form is returning the field name, not the CONTENTS of that field. Change the first one to be:
locate for alltrim(upper(EVAL(thisform.ocurrcolumn.controlsource))) ;
= alltrim(upper(thisform.txtfind.value))
(added an EVAL function around the controlsource)
>>>Hi Bruce,
>>>
>>>I tried:
>>>SELECT(oHeader.Parent.ControlSource)
>>>and
>>>SELECT(oHeader.Parent.Parent.RecordSource)
>>>and both kept me on the correct view.
>>
>>That's what I meant to say, the view alias...but same result either way.
>>
>>>I had in the debugger watch
>>>ALIAS(SELECT())
>>>and I stayed on the same view.
>>>The contents of oHeader.Parent.ControlSource allways equals CustView.fname which is the column that I right clicked on...
>>>
>>>Could the problem be with the view???
>>
>>I would repeat these things in the Command window with the debugger stopping execution, and also testing the view/Locate without the grid object references. Keep your view in browse mode, see what works and what doesn't, to isolate the problem...