Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LOCATE error
Message
De
03/05/1999 12:04:00
 
 
À
03/05/1999 12:02:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00214516
Message ID:
00214583
Vues:
16
>>You are probably on track to the problem, but I don't want to go to the first record for a particular User_ID. All I want to do in mGoTop() is move the record pointer to the first record in the current table irregardless of any order. According to several articles in Fox Advisor on a SET FILTERED table issue LOCATE by itself instead of Go Top (much faster). I also get the error if I issue SKIP -1 or SKIP 1.
>>
>>>The oDataLib class is not contained in the form, thus doesn't see the reference to THISFORM.
>>>
>>>One way to get around this is to pass the property to the method:
>>>
>>>THISFORM.oDataLib.mGoTop(THISFORM.cCurrentUserID)
>>>
>>>In mGoTop():
>>>
>>>LPARAMETERS tcCurrentUserID
>>>
>>>LOCATE FOR User_ID = tcCurrentUserID
>>>
>>>HTH
>>>
>>>>I have a form that is loaded at runtime via NEWOBJECT().
>>>>
>>>>In its init() I load a data object via NEWOBJECT() and store a reference to that data object in a form method named oDataLib. I also do the following in the Init.
>>>>
>>>>THISFORM.cCurrentUserId = oAppLib.mGetUserId()
>>>>
>>>>SELECT rqst_ord
>>>>SET FILTER TO user_id = THISFORM.cCurrentUserId
>>>>LOCATE
>>>>
>>>>On the form is a VCR button for Go Top. In the click event I call:
>>>>
>>>>THISFORM.oDataLib.mGoTop()
>>>>
>>>>Inside of this method is the commmand: LOCATE
>>>>When this command is hit at runtime I receive an error "Object is not contained in a FORM".
>>>>
>>>>If I move the code out of the oDataLib.mGoTop() and put it directly inside of the command button the code runs fine.
>
>
>Do you have a SET FILTER TO for this table that uses ThisForm ?

Duh, of course you do! I just saw it in the code above. You'll need to reference that as a variable that is passed the form reference to the method code.
Fred
Microsoft Visual FoxPro MVP

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

Click here to load this message in the networking platform