By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

combo box backcolor

P: n/a
I am wanting to have the backcolor of some combo boxes change acording
to what value is in the combo boxes in a report. The report can be
one page to multiple pages with the same combo boxes on each page.
The code I have tried is below.

Sub Form_Current()
Dim green As Long, yellow As Long, red As Long
Dim x As Long
green = RGB(0, 255, 0)
yellow = RGB(255, 255, 0)
red = RGB(255, 0, 0)
x = 1
Do
Me.Page = x
If Me![Neck & Shoulder Force] = "High" Then
Me![Neck & Shoulder Force].BackColor = red
Else
End If
If Me![Neck & Shoulder Force].Value = "Moderate" Then
Me![Neck & Shoulder Force].BackColor = yellow
Else
End If
If Me![Neck & Shoulder Force] = "Low" Then
Me![Neck & Shoulder Force].BackColor = green
Else
End If
x = x + 1
While x <= Me.Pages
End Sub

It's been a while since I've programmed so any help would be
beneficial. Thanks.

Matt
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
See reply to Dwight posted a few minutees ago, topic: Chnage Colour in Combo
Box. Seems to be the same issue.

"Matt" <ml*****@ksu.edu> wrote:
I am wanting to have the backcolor of some combo boxes change acording
to what value is in the combo boxes in a report. The report can be
one page to multiple pages with the same combo boxes on each page.
The code I have tried is below.

Sub Form_Current()
Dim green As Long, yellow As Long, red As Long
Dim x As Long
green = RGB(0, 255, 0)
yellow = RGB(255, 255, 0)
red = RGB(255, 0, 0)
x = 1
Do
Me.Page = x
If Me![Neck & Shoulder Force] = "High" Then
Me![Neck & Shoulder Force].BackColor = red
Else
End If
If Me![Neck & Shoulder Force].Value = "Moderate" Then
Me![Neck & Shoulder Force].BackColor = yellow
Else
End If
If Me![Neck & Shoulder Force] = "Low" Then
Me![Neck & Shoulder Force].BackColor = green
Else
End If
x = x + 1
While x <= Me.Pages
End Sub

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.