CindyKredo
New member
- Local time
- Today, 03:27
- Joined
- Nov 8, 2019
- Messages
- 27
I have a list of reports on a form (in a list box). When the user selects an item in this listbox, after update event code on the list of reports enables or disables four other list boxes on the form. This same code chunk changes the font in a disabled list box to be grey. Well - it is supposed to do that, and indeed does work for 3 listboxes on the form, but not one of them.
The code for each list box is exactly the same. They are all simple multi-select list boxes. I have compared every property on each list box to make sure they are all identical. (I've even tried removing the problem list box, recreating it from scratch in case something was buried that I can't see.)
I have stepped through the code - nothing is remiss. But the list box font stays black. (The only solution I can come up with is to do something like hide the ones that don't apply, but I hate to do that.) The commented out message code tells me the font color IS now grey - but that's not what the screen shows!
Any thoughts are appreciated! Thanks in advance.
The code for each list box is exactly the same. They are all simple multi-select list boxes. I have compared every property on each list box to make sure they are all identical. (I've even tried removing the problem list box, recreating it from scratch in case something was buried that I can't see.)
I have stepped through the code - nothing is remiss. But the list box font stays black. (The only solution I can come up with is to do something like hide the ones that don't apply, but I hate to do that.) The commented out message code tells me the font color IS now grey - but that's not what the screen shows!
Any thoughts are appreciated! Thanks in advance.
Code:
If Me.lstReports.Column(12) = True Then
Me.calcContactTypeCount = Me.lstContactTypes.ItemsSelected.Count
Me.lstContactTypes.ForeColor = RGB(0, 0, 0)
Me.lstContactTypes.Enabled = True
Else
Call ClearSelList(lstContactTypes)
Me.calcContactTypeCount = 0
Me.unbContactTypes = Null
'this is the list box where this forecolor does not change from black to grey
'yet the msgbox indicates it is now grey (it lies)
Me.lstContactTypes.ForeColor = RGB(211, 211, 211)
Me.lstContactTypes.Enabled = False
'msgbox "The contact type box forecolor is " & Me.lstcontactTypes.Forecolor
End If