Can "expression is" call a VB function?

  • Thread starter Maury Markowitz
  • Start date
M

Maury Markowitz

I'd like to wire up some conditional formatting on a form, but the logic is
somewhat complex. I could easily write it in VB, but I'm not sure how to
"connect" that to the conditional formatter. Can I call a VB function using
"expression is"? I can't find any examples of this if it is possible.

Maury
 
D

Dirk Goldgar

Maury Markowitz said:
I'd like to wire up some conditional formatting on a form, but the
logic is somewhat complex. I could easily write it in VB, but I'm not
sure how to "connect" that to the conditional formatter. Can I call a
VB function using "expression is"? I can't find any examples of this
if it is possible.

Sure. See some of the magic wrought by Stephen Lebans at

http://www.lebans.com/conditionalformatting.htm
 
A

Albert D. Kallal

Sure, just use:


Expression is (MyCoolFunction() = True)

You can even pass values in the above function....

Expression is (MyCoolFunction([MyFieldName]) = True)

And, of course, you can just use general expressions like:

Expression is ([MyFieldName] = "Hello")

Also, you can for sake of maintainablity put the function in the forms
module, but I think you do have to declare it as public....(try both)
 
Top