A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional Formatting not working in report detail



 
 
Thread Tools Display Modes
  #1  
Old June 25th, 2009, 06:53 AM posted to microsoft.public.access.tablesdbdesign
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default Conditional Formatting not working in report detail

i have an access2007 report that i am trying to setup conditional formatting
where the user sets the "Alert Value" by a single record in a table here is
my expression

[LastAttendance]Date()-DLookUp("[alertvalue]","alertvalue")

this works great on the controls in my section header but i want to use it
in my section detail where [lastattendance] actually resides.. if i click a
control in my detail while viewing the report the control turns red unless
the specific control doesnt meet the expressions criteria.. but it only
changes temporarily while the control has the focus?

i replaced the expression with 1 = 1 and "1" = "1" but the detail
controls would turn red while the header controls will do i have a property
somewhere that is preventing this??

i hope i have enough detail
Thanks
  #2  
Old June 25th, 2009, 01:24 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Conditional Formatting not working in report detail

Your DLookup() expression has no criteria, so I assume there is just one
record in the alertvalue table, and you want to apply it to all records in
your form. I assume that the alertvalue field is a Number type (since you
are subtracting it from a date.)

To make this efficient, the DLookup() only needs to be done once when the
form opens, not for every record. Therefore put a text box in your Form
Header section, and give it these properties:
Control Source =DLookUp("[alertvalue]","alertvalue")
Format General Number
Visible No
Name txtAlertValue

Now try setting the Conditional Formatting for your text box to:
Expression [LastAttendance] Date() - [txtAlertValue]

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Barry A&P" wrote in message
...
i have an access2007 report that i am trying to setup conditional
formatting
where the user sets the "Alert Value" by a single record in a table here
is
my expression

[LastAttendance]Date()-DLookUp("[alertvalue]","alertvalue")

this works great on the controls in my section header but i want to use it
in my section detail where [lastattendance] actually resides.. if i click
a
control in my detail while viewing the report the control turns red unless
the specific control doesnt meet the expressions criteria.. but it only
changes temporarily while the control has the focus?

i replaced the expression with 1 = 1 and "1" = "1" but the detail
controls would turn red while the header controls will do i have a
property
somewhere that is preventing this??

i hope i have enough detail
Thanks


  #3  
Old June 25th, 2009, 05:47 PM posted to microsoft.public.access.tablesdbdesign
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default Conditional Formatting not working in report detail

allen

your assumptions are correct with my dlookup criteria the table only has one
record. is my set alert value form with a text box bound to a table with
one record and one field the wrong approach? you usually have extremely
simple fixes for the stupid stuff us learners tend to do. is there a better
way to store a single value that can be used to set my conditional formatting
on all reports (in a runtime database)


Thanks so much for the suggestion of adding a hidden txtalertvalue control
it really helped with my forms performance but it did not fix my conditional
formatting..

i am reasonably sure the expression is working but for some reason a
property somewhere is preventing or overriding the the conditional formatting
is this possible??

Thanks for doing what you do

Barry

"Allen Browne" wrote:

Your DLookup() expression has no criteria, so I assume there is just one
record in the alertvalue table, and you want to apply it to all records in
your form. I assume that the alertvalue field is a Number type (since you
are subtracting it from a date.)

To make this efficient, the DLookup() only needs to be done once when the
form opens, not for every record. Therefore put a text box in your Form
Header section, and give it these properties:
Control Source =DLookUp("[alertvalue]","alertvalue")
Format General Number
Visible No
Name txtAlertValue

Now try setting the Conditional Formatting for your text box to:
Expression [LastAttendance] Date() - [txtAlertValue]

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Barry A&P" wrote in message
...
i have an access2007 report that i am trying to setup conditional
formatting
where the user sets the "Alert Value" by a single record in a table here
is
my expression

[LastAttendance]Date()-DLookUp("[alertvalue]","alertvalue")

this works great on the controls in my section header but i want to use it
in my section detail where [lastattendance] actually resides.. if i click
a
control in my detail while viewing the report the control turns red unless
the specific control doesnt meet the expressions criteria.. but it only
changes temporarily while the control has the focus?

i replaced the expression with 1 = 1 and "1" = "1" but the detail
controls would turn red while the header controls will do i have a
property
somewhere that is preventing this??

i hope i have enough detail
Thanks



  #4  
Old June 25th, 2009, 06:05 PM posted to microsoft.public.access.tablesdbdesign
Barry A&P[_2_]
external usenet poster
 
Posts: 119
Default Conditional Formatting not working in report detail

Allen

Got it the control backstyle was set to transparent, Normal fixed the
problem..
Thank you again for your help..

Barry

"Allen Browne" wrote:

Your DLookup() expression has no criteria, so I assume there is just one
record in the alertvalue table, and you want to apply it to all records in
your form. I assume that the alertvalue field is a Number type (since you
are subtracting it from a date.)

To make this efficient, the DLookup() only needs to be done once when the
form opens, not for every record. Therefore put a text box in your Form
Header section, and give it these properties:
Control Source =DLookUp("[alertvalue]","alertvalue")
Format General Number
Visible No
Name txtAlertValue

Now try setting the Conditional Formatting for your text box to:
Expression [LastAttendance] Date() - [txtAlertValue]

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Barry A&P" wrote in message
...
i have an access2007 report that i am trying to setup conditional
formatting
where the user sets the "Alert Value" by a single record in a table here
is
my expression

[LastAttendance]Date()-DLookUp("[alertvalue]","alertvalue")

this works great on the controls in my section header but i want to use it
in my section detail where [lastattendance] actually resides.. if i click
a
control in my detail while viewing the report the control turns red unless
the specific control doesnt meet the expressions criteria.. but it only
changes temporarily while the control has the focus?

i replaced the expression with 1 = 1 and "1" = "1" but the detail
controls would turn red while the header controls will do i have a
property
somewhere that is preventing this??

i hope i have enough detail
Thanks



 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.