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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamicforecolor

Status
Not open for further replies.

LouisC4

Programmer
Jul 26, 2003
54
US
Hello, I am getting this message when I am assigning a dynaicforecolor to my grid.

error message is:

Expression is invalid. Use a valid expression for DYNAMICFORECOLOR property

Here is the code I am using:

acn = "512343"

ThisForm.grdGl_journal.SetAll("DynamicForeColor",;
"IIF(acc_num = acn, RGB(0,0,200), RGB(0,0,0))", "Column")


However the code works fine when I do this:

ThisForm.grdGl_journal.SetAll("DynamicForeColor",;
"IIF(acc_num = "512343", RGB(0,0,200), RGB(0,0,0))", "Column")


Any suggestions?

Louis
 
Loui4C

It the acn variable "outside" of the init? Perhaps a local varariable that goes out of scope? Try making the variable public.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Change it to:

ThisForm.grdGl_journal.SetAll("DynamicForeColor",;
"IIF(acc_num = eval('acn'), RGB(0,0,200), RGB(0,0,0))", "Column")

Note the apostrophes VS quotes in the eval() call

Darrell



'We all must do the hard bits so when we get bit we know where to bite' :)
 
Thanks for your input Mgagnon and Darrel,

Mike, I do declare acn in the ini method and I have tried it public, it still wont work.

Darrel, I still get the same message with your method and I did use EVAL('acn') and not EVAL("acn"). I've even tried it without the quote.

Any other ideas?

thanks again,

Louis

 
Hi all,

I got it to work. The solution was using EVAL('acn') as Darrell said. My error was that I had changed the assigning of acn from:

acn = "512343" to acn = '512343'

Now it works fine.

Thanks again,

Louis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top