Continuous Form Control Setting (Select Case)

Joined
Sep 20, 2012
Messages
2
Reaction score
0
On a continuous form I have 2 controls tblStatusName and tblPCCustomerName
I am trying to set the backcolor for each tblCustomerName based on the first character of the tblStatusName

The following sets the backcolor to ALL tblPCCustomerName controls to Red

I'm stumped and could use some help

TIA

Code:
Private Sub Form_Load()

Dim strStatus As String
strStatus = Left(Me.tblStatusName, 1)


Select Case strStatus

Case 0 To 1
'Left(Me.tblStatusName, 1) = "0"
'Left(Me.tblStatusName, 1) = "1"
Me.tblPCCustomerName.BackColor = rgb(255, 255, 0)


Case 2 To 4
'Left(Me.tblStatusName, 1) = "2"
'Left(Me.tblStatusName, 1) = "3"
'Left(Me.tblStatusName, 1) = "4"
Me.tblPCCustomerName.BackColor = rgb(255, 204, 0)

Case 6
'Left(Me.tblStatusName, 1) = "6"
 Me.tblPCCustomerName.BackColor = rgb(153, 204, 0)

Case Else
'Left(Me.tblStatusName, 1) = ""
 Me.tblPCCustomerName.BackColor = rgb(255, 0, 0)

End Select


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top