If you go with the two set of textboxes there will be a lot of modifications throughout the database, forms, and code.
The better coice may be to change the format choice of the textboxes from "Plain Text" to "Rich Text".
Then if there are two or more records you could then apply different formatting (text color and text highlight) to each absence.
So what you would have to do is select all your textboxes and under the data tab change the
"Text Format " from "Plain Text" to "Rich Text"
Now as you build your text string you are going to wrap it in html tags. To make things easier put the tags in the table.
So here is the string for the word "absence One" with red background and black text. (Absence One represents one of your codes)
<font color="#0C0C0C" style="BACKGROUND-COLOR:#FF0000">Absence One</font>
So if these tags are kept in the table your code would look something like
Code:
Do While Not rsDay.EOF
AbsenceCode = rsDay!AbsenceCode
AbsenceColorTag = rsDay!AbsenceColorTag "The html tag stored in the table
AbsenceCode = absenceColorTag & AbsenceCode & "</font>"
If strCodes = "" Then
strCodes = AbsenceCode
Else
strCodes = strCodes & "," & AbsenceCode
End If
AbsenceTextColorCode = rsDay!AbsenceTextColorCode
AbsenceColorCode = rsDay!AbsenceColorCode
rsDay.MoveNext
Loop
'I think you actually need to wrap it with a <div> </div>
strCodes = "<div>" & strCodes & "</div>"
The final string for two codes, first is black text red background, second is white text blue background would look like this:
<div>
<font color="#0C0C0C" style="BACKGROUND-COLOR:#FF0000">Absence One</font>
<font color=white style="BACKGROUND-COLOR:#000080"> Absence Two</font>
</div>
This may not look as good because only the text is highlighted not the whole text box, but the calendar will look better. So what you could do is if there is only one record for the day is choose to highlight the wholed textbox, if more than one use the richtext formats.
So you could do a recordset count first
Code:
if rsDay.recordcount > 1 then
Do While Not rsDay.EOF
AbsenceCode = rsDay!AbsenceCode
AbsenceColorTag = rsDay!AbsenceColorTag "The html tag stored in the table
AbsenceCode = absenceColorTag & AbsenceCode & "</font>"
If strCodes = "" Then
strCodes = AbsenceCode
Else
strCodes = strCodes & "," & AbsenceCode
End If
AbsenceTextColorCode = rsDay!AbsenceTextColorCode
AbsenceColorCode = rsDay!AbsenceColorCode
rsDay.MoveNext
Loop
else
Do While Not rsDay.EOF
AbsenceCode = rsDay!AbsenceCode
If strCodes = "" Then
strCodes = AbsenceCode
Else
strCodes = strCodes & "," & AbsenceCode
End If
AbsenceTextColorCode = rsDay!AbsenceTextColorCode
AbsenceColorCode = rsDay!AbsenceColorCode
rsDay.MoveNext
Loop
end if