Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert 'fieldB' in a grid if 'fieldA' is empty
Message
De
13/05/2014 02:23:31
 
 
À
12/05/2014 23:33:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01599900
Message ID:
01599902
Vues:
81
>Hi. VFP7 user. I am working with a grid. I want to say
>
IIF ( EMPTY(fieldA), fieldB, fieldA )
>I tried placing the code in the control source. Got "must be a variable ref" error.
>My q: where can I put this code where it will act on every row of the grid?

A couple of SWAGs, not tested:

- in some cases prefacing with "=" can help e.g. try =IIF( EMPTY(fieldA), fieldB, fieldA )
- you might try wrapping it or replacing with EVALUATE( )

Whenever I've found myself trying to do things like this with grids, I've taken it as a cue to generate cursor(s) on the fly and use them as the grid .RecordSource instead.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform