Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 27th, 2003, 04:06 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
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

Reply With Quote
  #2  
Old December 3rd, 2003, 05:38 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
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."

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Using FormatCondition object in VBA


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway