Kaup, Chester
Chester_Kaup at kindermorgan.com
Thu Apr 9 12:48:42 CDT 2009
I don't if this will help you or give you any ideas but I used this code to color text in text boxes in the detail section of a report. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Last_IT_Date < Date - 10 Then Last_IT_Date.ForeColor = vbRed Else Last_IT_Date.ForeColor = vbBlack End If If Stat_Code = "WI" And Lin_pres > 1850 Then Lin_pres.ForeColor = vbRed ElseIf Stat_Code = "WI" Then Lin_pres.ForeColor = vbBlack End If If Stat_Code = "CI" And Lin_pres > 2180 Then Lin_pres.ForeColor = vbRed ElseIf Stat_Code = "CI" Then Lin_pres.ForeColor = vbBlack End If End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 09, 2009 11:21 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Empty Field Label Dear List: I think it was Gustav that turned me on to putting some text into an empty bound text box using: @;"Select Matter "[Red] which displays the words 'Select Matter' in red if the field bound to the text box is null. Works great in a continuous form. My client now wants to extend this to combo boxes. I tried it but it didn't work. Probably because the first column of the combo box is zero width - containing the PK. Is there a way to use @;"Select Matter "[Red] so that it will display in the second column of the combo box? He also wants to extend this technique to text boxes that already have a format. For example, the 'Date Worked' field has ddd d-mmm-yyyy for a format. If the field does not have a date he'd like the words 'Date Worked' to appear in red. But if I paste @;"Date Worked"[Red] into the format property it'll override the date format when there's a date in the field. Any way to finesse that one? MTIA, Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com <http://www.e-z-mrp.com/> www.bchacc.com <http://www.bchacc.com/>