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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Change text based on date
I want to change the text color on a report using the attached code but can't
get it to wor not sure where I'm going wrong txtOrderDueDate is a long date? 12/08/2009 Private Sub Report_Load() If Me.txtOrderDueDate.Value = Date + 2 Then Me.txtOrderDueDate.ForeColor = RGB(255, 0, 0) Else Me.txtOrderDueDate.ForeColor = RGB(0, 255, 0) End If End Sub Thanks! Jerry -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200912/1 |
#2
|
|||
|
|||
Change text based on date
jbair via AccessMonster.com wrote:
I want to change the text color on a report using the attached code but can't get it to wor not sure where I'm going wrong txtOrderDueDate is a long date? 12/08/2009 Private Sub Report_Load() If Me.txtOrderDueDate.Value = Date + 2 Then Me.txtOrderDueDate.ForeColor = RGB(255, 0, 0) Else Me.txtOrderDueDate.ForeColor = RGB(0, 255, 0) End If End Sub A Report's Load event is not used for Preview or Normal views (I think it's only for web reports). Instead use the Format or Print event of the section containing the txtOrderDueDate text box. Alternatively, you could use COnditional Formatting. -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Change text based on date
Thanks Marshall works great now!
Marshall Barton wrote: I want to change the text color on a report using the attached code but can't get it to wor not sure where I'm going wrong [quoted text clipped - 7 lines] End If End Sub A Report's Load event is not used for Preview or Normal views (I think it's only for web reports). Instead use the Format or Print event of the section containing the txtOrderDueDate text box. Alternatively, you could use COnditional Formatting. -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|