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

conditional formatting depending on another control 1

Status
Not open for further replies.

jamaarneen

Programmer
Dec 27, 2007
213
BE

Hi

i would like to apply conditional formatting, in a continious form - for each record.
[the conditional formatting from the format toolbar, will give ALL the records the same format, according to the conditions of the first record. so we have to do it in VBA.]

I have succeed to make it work (in another form), as long the condition was "if Field Value is, Operator, value":
Code:
... .FormatConditions.Add(acFieldValue, acGreaterThan, "1000")

but now I want to make the condition based on another control. so it would have to be some thing like:
Code:
... .FormatConditions.Add(acExpression, [i]OtherControlOrField[/i] = 1)

but I'm getting een error 2439: "the expression you entered has a function containnig the wrong number of arguments".

So I'm confused, how do I have to enter an additional argument, if my condition is: "expression is" (not "field value is")?

Thanks for your help, Ja
 
I still quite don't understand why you can't use the GUI for your conditional formatting ...
 

Thanks for your quick respond

If I use the GUI, then ALL the records of the continuous form, will be formatted according to the condition if the current record.
sinds ther is only one current record at the time, ALL records will have teh same formatting, depending on the condition from the current record.

so that's why I tried to worh this out in VBA. (And it works great, as mentioned above, but not in this situation).

Ja
 
How are ya jamaarneen . . .

[blue]PHV[/blue] appears to be right when I look at your post origination.

Unless your going to have more than 4 conditions (default condition + 3 others), [purple]whats wrong with the GUI?[/purple] ...

It appears you have a simple:
Code:
[blue]Expression Is [[purple][B][I]ControlName[/I][/B][/purple]] = 1[/blue]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
jamaarneen . . .

Note: [purple]ControlName[/purple] has to be a bound control! . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
HiAll of you,

Sorry Sorry and again sorry of waseting your time.

You were - and still are - right.
using the GUI works perfect...

it seems that at this hours (here 2:00 in the morning...) I will do beter taking some rest...

my appologies, and thanks for your help
Ja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top