VBA Access - Form color changes (status indicator) for single record

Joined
Mar 18, 2009
Messages
3
Reaction score
0
Currently when I select one of the toggle buttons, it changes all records. How do I get it to change only the current record.

My problem is on my form "Case Details" from the "Customer Service" template when I select any button.

I'm trying to change the backcolor of my option group "Status Indicator" control by selecting 1 of 4 toggle buttons "Green", "Amber", "Red", and "Black" with the default being "White" or transparent to the form.

When one of these buttons are selected on the control the back color will change. Anything else the field stays in its default color.

Each record or case will have its own status indicator.

Here is my code:

Private Sub StatusIndicator_Click()
Select Case StatusIndicator
Case "1"
[StatusIndicator].BackColor = vbGreen
Case "2"
[StatusIndicator].BackColor = vbYellow
Case "3"
[StatusIndicator].BackColor = vbRed
Case "4"
[StatusIndicator].BackColor = vbBlack
Case Else
[StatusIndicator].BackColor = vbWhite
End Select
End Sub

My Cases Table has the following columns
ID, Title, Assigned To, CustomerBDE, Caller, Opened By, Customer, Status, StatusIndicator, Category, Priority, Description, Due Date, Comments, Resolved Date, Related Cases, KB, Attachments, CSP_Num

Where Status is "Active", "Resolved", or "Closed" and is not related to the Indicator which is an additional identifier for each case.
Where StatusIndicator is the value of the selected ToggleButton "Green" = 1, "Amber" = 2, "Red" = 3, "Black" = 4.

I created the StatusIndicator field so the button that was selected was saved in the record otherwise the same effect would occur and which ever button i selected would apply to all records. Should I create a new column "StatusColor" to capture the color value of the [StatusIndicator].backcolor. That seems redundant and I believe it will not work. I've been spinning on this for a few days now and need some guidance.

- Jamie R. Dayton
InfoTech Management INTL
CEO & Information Systems Engineer
 

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