G
Gnerks
I am working in Access 2007 with reports. I have two text boxes one is
populated (from a 6 field table) with a series of statuses (Complete,
Delayed, Unsigned MOA, etc.). The second textbox is populated (from the same
table) with the titles of studies and each study name is different. When
the report loads I want each study with a status of Complete to have either
the backcolor or the forecolor blue in the study title text box, if the
status is Delayed then red, etc. Both textboxes are bound to the appropriate
field from my table.
I tried the Select Case statement provided by Wayne Morgan in a CONDITIONAL
question but it is not working. I can get the color to change in the study
title column with the Select Case in the Report_Current() event if I click on
a status field. For example if the first record has a status of COMPLETE and
i click on this, all of the Study Title boxes turn blue, or red for Delayed.
I need it to look at one record at a time and base the color of the title
textbox on the text of the status textbox. My code follows:
Option Compare Database
Private Sub Report_Current()
Select Case Me.txtStatus
Case "COMPLETE"
Me.txtStudyTitle.BackColor = RGB(30, 144, 255)
Case "DELAYED"
Me.txtStudyTitle.BackColor = vbRed
Case "[UNSIGNED MOA]" 'used brakets because two words
Me.txtStudyTitle.BackColor = vbGreen
End Select
End Sub
Any help would be appreciated!
populated (from a 6 field table) with a series of statuses (Complete,
Delayed, Unsigned MOA, etc.). The second textbox is populated (from the same
table) with the titles of studies and each study name is different. When
the report loads I want each study with a status of Complete to have either
the backcolor or the forecolor blue in the study title text box, if the
status is Delayed then red, etc. Both textboxes are bound to the appropriate
field from my table.
I tried the Select Case statement provided by Wayne Morgan in a CONDITIONAL
question but it is not working. I can get the color to change in the study
title column with the Select Case in the Report_Current() event if I click on
a status field. For example if the first record has a status of COMPLETE and
i click on this, all of the Study Title boxes turn blue, or red for Delayed.
I need it to look at one record at a time and base the color of the title
textbox on the text of the status textbox. My code follows:
Option Compare Database
Private Sub Report_Current()
Select Case Me.txtStatus
Case "COMPLETE"
Me.txtStudyTitle.BackColor = RGB(30, 144, 255)
Case "DELAYED"
Me.txtStudyTitle.BackColor = vbRed
Case "[UNSIGNED MOA]" 'used brakets because two words
Me.txtStudyTitle.BackColor = vbGreen
End Select
End Sub
Any help would be appreciated!