Steve Schapel
steve at datamanagementsolutions.biz
Tue Feb 12 16:23:53 CST 2013
Hi Brad I think Rocky's suggestion is correct... that it has to do with the timing of when the Conditional Formatting is applied to the report, as against when the data is there for the CF process to evaluate. Is it possible to put the code on the report's Open event rather than Load? That might work. Alternatively, are you able to re-jig your code into a function to return the value required for the field, and then to call that function, either in a calculated field within the report's Record Source query, or in the Control Source of the textbox? That might work too. Regards Steve -----Original Message----- From: Brad Marks Sent: Wednesday, February 13, 2013 11:10 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Conditional Formatting Puzzler - Access 2007 Steve, In order to debug this problem, I have set up a little test Access application that recreates the problem. The Report "Load" event calls a small VBA routine which sets the value of the Text Box on the Report. The value that is displayed on the report is correct. It just is not shown in red via the conditional formatting that I have set up. I think that I am missing something here. Thanks, Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Schapel Sent: Tuesday, February 12, 2013 3:59 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Conditional Formatting Puzzler - Access 2007 Brad What event are you using to assign the value to the textbox? Regards Steve -----Original Message----- From: Brad Marks Sent: Wednesday, February 13, 2013 9:41 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Conditional Formatting Puzzler - Access 2007 David, The Text Box on the Report has a format of "Currency". The field in the VBA code is defined as "Currency". The field on the report does not come from a table or query, but is filled in via VBA code. Just for fun, I set up a small table and query in the application to experiment with Conditional Formatting. Things work fine for these fields from the query. I am still puzzled. Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David A Gibson Sent: Tuesday, February 12, 2013 2:37 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Conditional Formatting Puzzler - Access 2007 Check the Data Type of the field. David Gibson -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Tuesday, February 12, 2013 2:24 PM To: Access Developers discussion and problem solving Subject: [AccessD] Conditional Formatting Puzzler - Access 2007 All, I have used Conditional Formatting a few times in the past and never ran into any problems. Recently, I stumbled upon something that seems strange. I have an Access 2007 report with an amount field. If the amount is negative, I simply want to change the font color to red. I set up a single "Conditional Formatting" condition that says "Field Value Is" "Less than" 0. The Preview shows the field in red. However, when I view the report, the field is shown in black and not in red. I must be missing something. This seems so simple. It appears that Access is not detecting that the fields is negative. Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com