Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert 'fieldB' in a grid if 'fieldA' is empty
Message
From
13/05/2014 02:23:31
 
 
To
12/05/2014 23:33:09
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01599900
Message ID:
01599902
Views:
80
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform