Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reference a form from another form
Message
De
23/04/1999 13:45:26
 
 
À
22/04/1999 18:35:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00207251
Message ID:
00211620
Vues:
30
>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...
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform