Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid--conditonal formatting on memo field

Status
Not open for further replies.

rgw

Technical User
Sep 14, 2000
70
US
Normally have no trouble with conditional formatting in grid but having no luck when the test is based on whether a memo field is empty. Help appreciated.
 
Rather than EMPTY() you might try... LEN(ALLTRIM(table.memofield)) I do not know if it will help but it has solved other memo related issues for me in the past.

Here is another one I've used in queries to place default values in a memo before...

IIF(ISNULL(asdesc.descmem),temp.dummy,asdesc.descmem)


-Pete
 
Hi RGW,

The Empty() function evaluates data types differently.

For Example, if I have a table with the following fields:

MyCharField C (5)
MyMemoField M

and I do the following:

Replace MyCharField with Space(5)
Replace MyMemoField with Space(5)

EMPTY(MyTable.MyCharField) && Returns True
EMPTY(MyTable.MyMemoField) && Returns False

See EMPTY() function in the VFP help for exactly what a field can contain and still evaluate to empty.

Are you certain the offending memo field contains no spaces, carriage returns or line feeds? Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Thanks for the replies to the grid problem. Knowing the catchs with the empty() command I had checked the validity of the command with the memo field and it returns the expected value. Unfortunately, the offered fixes don't seem to solve the problem. No disaster but it would have been nice to have color marked the records with text in the memo field. If anyone else has any thoughts would be appreciated.
 
Post the code that you are using to make the color change.
-Pete
 
MyForm.MyMemoColumn.DynamicForecolor='iif(empty(MyTable.MemoField),255,0)'

works for me. Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Many thanks: problem was a mismatch of quotes and commas caused by the use of empty() and not the usual numeric test. For anyone with the same problem the working code in the Init of the grid is ;
this.column7.dynamicforecolor="iif(empty(dbf.memofield),rgb(128,128,128), rgb(255,0,0))"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top