S
SHIPP
I have written the following code in Access 2003 to change the background and
foreground colors of the fields. Sunday works just fine. After that if it
executes the else command both the foreground and background are shifted to
white (You can't see anything on the report). Any ideas?
' Firm Orders
If Me.FirmSun = 0 Then
Me.txtSunOrd.FontBold = False
Me.txtSunOrd.BackColor = vbWhite
Me.txtSunOrd.ForeColor = vbBlack
Else
Me.txtSunOrd.FontBold = True
Me.txtSunOrd.BackColor = vbBlue
Me.txtSunOrd.ForeColor = vbWhite
End If
If Me.FirmMon = 0 Then
Me.txtMonOrd.FontBold = False
Me.txtMonOrd.BackColor = vbWhite
Me.txtMonOrd.ForeColor = vbBlack
Else
' This code shifts the foreground and background to white. Consequently you
can't see anything on the report.
Me.txtMonOrd.FontBold = True
Me.txtMonOrd.BackColor = vbBlue
Me.txtMonOrd.ForeColor = vbWhite
End If
If Me.FirmTue = 0 Then
Me.txtTueOrd.FontBold = False
Me.txtTueOrd.BackColor = vbWhite
Me.txtTueOrd.ForeColor = vbBlack
Else
Me.txtTueOrd.FontBold = True
Me.txtTueOrd.BackColor = vbBlue
Me.txtTueOrd.ForeColor = vbWhite
End If
If Me.FirmWed = 0 Then
Me.txtWedOrd.FontBold = False
Me.txtWedOrd.BackColor = vbWhite
Me.txtWedOrd.ForeColor = vbBlack
Else
Me.txtWedOrd.FontBold = True
Me.txtWedOrd.BackColor = vbBlue
Me.txtWedOrd.ForeColor = vbWhite
End If
If Me.FirmThu = 0 Then
Me.txtThuOrd.FontBold = False
Me.txtThuOrd.BackColor = vbWhite
Me.txtThuOrd.ForeColor = vbBlack
Else
Me.txtThuOrd.FontBold = True
Me.txtThuOrd.BackColor = vbBlue
Me.txtThuOrd.ForeColor = vbWhite
End If
If Me.FirmFri = 0 Then
Me.txtFriOrd.FontBold = False
Me.txtFriOrd.BackColor = vbWhite
Me.txtFriOrd.ForeColor = vbBlack
Else
Me.txtFriOrd.FontBold = True
Me.txtFriOrd.BackColor = vbBlue
Me.txtFriOrd.ForeColor = vbWhite
End If
If Me.FirmSat = 0 Then
Me.txtSatOrd.FontBold = False
Me.txtSatOrd.BackColor = vbWhite
Me.txtSatOrd.ForeColor = vbBlack
Else
Me.txtSatOrd.FontBold = True
Me.txtSatOrd.BackColor = vbBlue
Me.txtSatOrd.ForeColor = vbWhite
End If
foreground colors of the fields. Sunday works just fine. After that if it
executes the else command both the foreground and background are shifted to
white (You can't see anything on the report). Any ideas?
' Firm Orders
If Me.FirmSun = 0 Then
Me.txtSunOrd.FontBold = False
Me.txtSunOrd.BackColor = vbWhite
Me.txtSunOrd.ForeColor = vbBlack
Else
Me.txtSunOrd.FontBold = True
Me.txtSunOrd.BackColor = vbBlue
Me.txtSunOrd.ForeColor = vbWhite
End If
If Me.FirmMon = 0 Then
Me.txtMonOrd.FontBold = False
Me.txtMonOrd.BackColor = vbWhite
Me.txtMonOrd.ForeColor = vbBlack
Else
' This code shifts the foreground and background to white. Consequently you
can't see anything on the report.
Me.txtMonOrd.FontBold = True
Me.txtMonOrd.BackColor = vbBlue
Me.txtMonOrd.ForeColor = vbWhite
End If
If Me.FirmTue = 0 Then
Me.txtTueOrd.FontBold = False
Me.txtTueOrd.BackColor = vbWhite
Me.txtTueOrd.ForeColor = vbBlack
Else
Me.txtTueOrd.FontBold = True
Me.txtTueOrd.BackColor = vbBlue
Me.txtTueOrd.ForeColor = vbWhite
End If
If Me.FirmWed = 0 Then
Me.txtWedOrd.FontBold = False
Me.txtWedOrd.BackColor = vbWhite
Me.txtWedOrd.ForeColor = vbBlack
Else
Me.txtWedOrd.FontBold = True
Me.txtWedOrd.BackColor = vbBlue
Me.txtWedOrd.ForeColor = vbWhite
End If
If Me.FirmThu = 0 Then
Me.txtThuOrd.FontBold = False
Me.txtThuOrd.BackColor = vbWhite
Me.txtThuOrd.ForeColor = vbBlack
Else
Me.txtThuOrd.FontBold = True
Me.txtThuOrd.BackColor = vbBlue
Me.txtThuOrd.ForeColor = vbWhite
End If
If Me.FirmFri = 0 Then
Me.txtFriOrd.FontBold = False
Me.txtFriOrd.BackColor = vbWhite
Me.txtFriOrd.ForeColor = vbBlack
Else
Me.txtFriOrd.FontBold = True
Me.txtFriOrd.BackColor = vbBlue
Me.txtFriOrd.ForeColor = vbWhite
End If
If Me.FirmSat = 0 Then
Me.txtSatOrd.FontBold = False
Me.txtSatOrd.BackColor = vbWhite
Me.txtSatOrd.ForeColor = vbBlack
Else
Me.txtSatOrd.FontBold = True
Me.txtSatOrd.BackColor = vbBlue
Me.txtSatOrd.ForeColor = vbWhite
End If