Hi gurus,
I have a combobox with 4 values in it on a datasheet form. Is there a way to have each value appear in a different color within the drop down and therefore displayed in the form once selected?
Thanks
Hi gurus,
I have a combobox with 4 values in it on a datasheet form. Is there a way to have each value appear in a different color within the drop down and therefore displayed in the form once selected?
Thanks
this is what I have been trying so far but I get a user defined type not defined error. I have this on the on current event of the form
Code:Option Compare Database Private Sub Form_Current() Dim dispo As Text, lngBlue As Long Dim lngRed As Long, lngYellow As Long, lngGreen As Long If Not IsNull(Me!Combo84.Value) Then dispo = Me!Combo84.Value Else Exit Sub End If lngRed = RGB(255, 0, 0) lngBlue = RGB(0, 64, 255) lngYellow = RGB(255, 255, 0) lngGreen = RGB(0, 178, 0) If dispo = "Proposal Sent" Then Me!Combo84.BackColor = lngRed ElseIf dispo = "Trade-In/Replaced" Then Me!Combo84.BackColor = lngBlue ElseIf dispo = "Kept/Renewed" Then Me!Combo84.BackColor = lngYellow Else Me!Combo84.BackColor = lngGreen End If End Sub
Pretty sure seen this question before. I don't think can do this with a normal combobox.
Options I know of: a form designed to look like listbox or a listview https://www.tek-tips.com/faqs.cfm?fid=6027
Last edited by June7; 05-27-2020 at 03:37 PM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Text isn't a data type, you want String.
Like June7, I don't think you can get the selections to be different colors when dropped down. You can certainly color the selected value, and Conditional Formatting might be easier.
No problem. Your code might work, but will set all records according to the selected record on a datasheet form, which probably isn't what you want. Formatting code like that only works well on a report, not a form (to get different formats on each record).