check here...
http://silverlight.net/for
Main Topics
Browse All TopicsHi
Need help please, with the following code.
Am trying to change datasheet cell colors when certain conditions are true. The code runs ok but cells do not change color.
When I step thru the debugger, under conditions where C2 = 1, I can see that 1 is passed to C2 and I can see that color 9553390 is passed to
the .BackColor property. So not sure why the datasheet cells are not changing color.
Is it because I need an array or loop statement to step thru all the records.
Need some guidance please
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
check here...
http://silverlight.net/for
Read in Access 2000 Programming for Dummies that FormatConditions requires a form control as the third parameter; have created an unbound text box called Status; the code runs but still cell does not change color. When testing the code the correct values appear to be passing so really should work ...
ohgee,
A few notes:
1. You did not give BColor a datatype when you declard it
2. Why not use conditional formatting from the menu, and not code it here?
3. If you want to build your own, then just use something like this:
If XXX=YYY then
ZZZ.BackColor=AAA
else
ZZZ.BackColor=vbWhite
End If
4. When I commented out lines 8 and 9, (in your code above) and set a default vale of 1 for "Status", the "Requirement" textbox did indeed change color.
5. Try this code on the Open Event, unless there is a specific reason why it has to be on the Load event.
(Remember, you can cancel the Open event, not the Load event)
JeffCoachman
Thanks for these comments.
Have given BColor a datatype.
I did want to solve by using the menu conditional format option but could not figure how to do it. The color must fire only if one or another conditions are true, and one of the conditions is based on a table that is not linked to the form. So I guess I need a DLookup for that; hence line 8 and 9.
I tried the code on Open Event but does not work. The really strange thing is that if I step thru the code the correct values are being passed. For example I can get status to be 1 and color 9553390
but the instruction does not change the cell color in the datasheet.
I'm not strong on coding (slowly getting to understand it) and I wonder if I dont need a loop; the cell that must change color is on a table at the end of three-table relationship
OK,
Then can you post a sample of your database (with sample data) that simulates this issue?
Post the sample with no code.
Then expain what textbox must change format.
Also state what the conditions are that will trigger the change.
For example:
"The format of the textbox XXX must change based on the value of YYY in table ZZZ
"If the value of YYY is AAA then the backcolor of XXX should be 9553390"
I am sure that any of us can help you.
;-)
Thanks
JeffCoachman
Business Accounts
Answer for Membership
by: itkamarajPosted on 2009-02-04 at 09:54:22ID: 23550997
Are you talking about the data grid cells ?