|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Using FormatCondition object in VBA
Hi Everybody,
I have a continuous form with several fields bound to a table containing a couple of thousands records. I'd like to cahnge the color of a field for records returning False for a specified expression. I know, that conditional formatting is available from VBA code by declaring and creating a FormatCondition object and add this object to the control's FormatConditions collection. That's clear for me, I have no problem with that, the code is: '******************************************* Dim fmc As FormatCondition Set fmc = MyControl.FormatConditions.Add(acFieldValue, acNotEqual,"MyValue") fmc.BackColor = vbRed '******************************************* My problem is, that it works properly ONLY if I put an exact value in the third parameter. If I put a function there that returns a string value, then the comparison runs ONLY for the first record, and if the first record becomes red, then all record become red. if it doesn't, then the other records also don't. I tried it in this way: '******************************************* Set fmc = MyControl.FormatConditions.Add(acExpression, ,MyControl <> MyFunction([parameter_list])) '******************************************* but the same result returns. Does anyone any idea to work it out? Or could anyone send me a help file with more details and samples using the FormatCondition object? VBA's Help has only a couple of lines about it and no example. Thanks, TBÁrpi |
|
#2
|
||||
|
||||
|
Any idea, anyone? ***sbaxter? ***Stev?
__________________
BRegs, TBÁrpi "I can only show you the door. You're the one who has to walk through it." |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Using FormatCondition object in VBA |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|