Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LOCATE error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00214516
Message ID:
00214613
Vues:
15
>>>Do you have a SET FILTER TO for this table that uses ThisForm ?
>>
>>Yes. In the FORMS init I have:
>>
>>
>>THISFORM.cCurrentUserId = oAppLib.getuserid()
>>
>>SELECT rqst_ord
>>SET FILTER TO user_id = THISFORM.cCurrentUserId
>>
>>
>>I tried several things EVAL(), & () trying to get the SET FILTER to persist in memory without referencing THISFORM.cCurrentUserId
>
>Try:
>
>SELECT rqst_ord
>LOCAL cFilterExp
>cFilterExp = "USER_ID =[" + thisform.cCurrentUserID + "]"
>SET FILTER TO &cFilterExp


Bingo, thank you very much.

I had tried the following but not your suggestion.

cUserId = oAppLib.getuserid()

SET FILTER TO user_id = &cUserId

I had a suspicion that using SET FILTER TO ... THISFORM... had something to do with it. But I could not see in my mind how to get to your idea on my own. I have used this type of macro sub in a couple of places in Fox 26 code a long time ago in abstracting the source for List Box population.

Using the watch window I knew that I wasn't there. I never thought of macro substituting the whole expression. I was afraid that I had hit a wall in placing all of the code for data access in an external object to forms.

Thanks again.
What ben makes tracks for what wil be. Words in the air pirnt foot steps on the groun for us to put our feet in to.

Riddley Walker
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform