Hello,
I am currently developing some scorecards for work which monitor and collate people performance score.
So far these scorecard have been developed in Excel using VB code to assit in the condictional formatting. I am now thinking it is time to more these spreadsheet into access under one location.
This brings me to my query. I can't seem to find away to have multiple condicational format using if statements. I have a grid (10x10) of text box's which you will enter a scoring number. The condictional format then formats the background colour of the box dependant on the value <>...
If anyone can help me incoroprate the code below into access would really appreciate it.
//Code used in Excel//
For Each cel In Range("B8:B20").Cells
If IsNumeric(cel.Value) And cel.Value <> "" Then
If cel.Value >= 0.905 Then
cel.Interior.ColorIndex = 44
ElseIf cel.Value >= 0.865 And cel.Value <= 0.905 Then
cel.Interior.ColorIndex = 50
ElseIf cel.Value >= 0.825 And cel.Value <= 0.865 Then
cel.Interior.ColorIndex = 35
ElseIf cel.Value >= 0.765 And cel.Value <= 0.825 Then
cel.Interior.ColorIndex = 40
ElseIf cel.Value <= 0.765 Then
cel.Interior.ColorIndex = 22
Else 'default conditions
cel.Interior.ColorIndex = 2
End If
Else
cel.Interior.ColorIndex = 2
End If
Many Thanks
Bantler
Edit....
I have been tired figuring this out but so far no joy.
Here is the code I have.
Private Sub TxtBox_Score_AfterUpdate()
If Me.TxtBoxScore.Value = "8" Then Me.TxtBox_Score.BackColor = vbRed
End If
End Sub
It doesn't seem to like the .Backcolor! Anyone any ideas how to fix this.
Thanks Again
Bantler
I am currently developing some scorecards for work which monitor and collate people performance score.
So far these scorecard have been developed in Excel using VB code to assit in the condictional formatting. I am now thinking it is time to more these spreadsheet into access under one location.
This brings me to my query. I can't seem to find away to have multiple condicational format using if statements. I have a grid (10x10) of text box's which you will enter a scoring number. The condictional format then formats the background colour of the box dependant on the value <>...
If anyone can help me incoroprate the code below into access would really appreciate it.
//Code used in Excel//
For Each cel In Range("B8:B20").Cells
If IsNumeric(cel.Value) And cel.Value <> "" Then
If cel.Value >= 0.905 Then
cel.Interior.ColorIndex = 44
ElseIf cel.Value >= 0.865 And cel.Value <= 0.905 Then
cel.Interior.ColorIndex = 50
ElseIf cel.Value >= 0.825 And cel.Value <= 0.865 Then
cel.Interior.ColorIndex = 35
ElseIf cel.Value >= 0.765 And cel.Value <= 0.825 Then
cel.Interior.ColorIndex = 40
ElseIf cel.Value <= 0.765 Then
cel.Interior.ColorIndex = 22
Else 'default conditions
cel.Interior.ColorIndex = 2
End If
Else
cel.Interior.ColorIndex = 2
End If
Many Thanks
Bantler
Edit....
I have been tired figuring this out but so far no joy.
Here is the code I have.
Private Sub TxtBox_Score_AfterUpdate()
If Me.TxtBoxScore.Value = "8" Then Me.TxtBox_Score.BackColor = vbRed
End If
End Sub
It doesn't seem to like the .Backcolor! Anyone any ideas how to fix this.
Thanks Again
Bantler
Last edited: