Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Column ControlSource to an Expression
Message
De
08/12/2008 05:28:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Setting Column ControlSource to an Expression
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01365914
Message ID:
01365914
Vues:
59
Greetings all.

I know that I know this, but I can't for the life of me dredge it out of my brain, so I'm figuring that if I ask here it will probably come to me seconds after I hit Send :-)

I have a column in a grid and I want the ControlSource to be an expression rather than just a field. For example -
.ControlSource = "MyUDF(MyField)"
This is working a lot of the time but every now and then I get a "variable is not found" error even though the MyField is in the RecordSource and the RecordSource is the currently selected table. I thought that ReadOnly had something to do with it, but that doesn't seem to help. If I do -
.ControlSource = "''+MyUDF(MyField)"
(That's two single quotes there on the beginning) it works. It's like VFP is thinking that MyUDF(MyField) is an array reference.

Does anyone know how to stop the error other than adding an empty string there at the beginning? I assume that I'd have to add 0 to numeric values etc, and since this is for some generic code, making sure that it knows the possible return value types from MyUDF is a bit tricky.

Ian Simcock.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform