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

Trouble with combo box background color...

patjones
Expert 100+
P: 931
Hi all:

I cannot figure this out for the life of me. I've got a combo box on my form called cboTitleCurrent. I set it's properties when the form opens as follows:

Expand|Select|Wrap|Line Numbers
  1.  
  2.     With cboTitleCurrent
  3.  
  4.         .BackStyle = 1
  5.         .BackColor = RGB(255, 255, 255)
  6.         .ColumnCount = 1
  7.         .BoundColumn = 1
  8.         .ListWidth = 2500
  9.         .ColumnWidths = "1.1 in"
  10.         .RowSourceType = "Value List"
  11.         .RowSource = "Lifeguard;Lieutenant;Chief;Borough Coordinator;Assistant Coordinator;Lifeguard Coordinator"
  12.         .ListRows = 6
  13.         .LimitToList = True
  14.         .AllowValueListEdits = False
  15.  
  16. End With
  17.  
  18.  
The background of my form is set to Access Theme 3 (light blue sort of), while the background of my combo box is supposed to be white. In fact, when the form first opens, it is white. But when I make a selection and then move the focus somewhere else, it changes to the same background as the form. This is despite the fact that I have it set to Normal (not Transparent), and also despite the fact that I put in:

Expand|Select|Wrap|Line Numbers
  1.  Private Sub cboTitleCurrent_LostFocus() 
  2.  
  3.     Me.cboTitleCurrent.BackColor = RGB(255, 255, 255)
  4.     Me.Repaint
  5.  
  6. End Sub
  7.  
  8.  
Nothing I do seems to make any difference...it just keeps reverting to light blue when it loses the focus. Any ideas?

Thanks,
Pat
Nov 16 '07 #1
Share this Question
Share on Google+
1 Reply


Megalog
Expert 100+
P: 378
I assume you're using Access 2007...

My combo boxes are behaving normally, and I just tried what you did.

Have you tried setting the combo box properties with the property sheet, instead of using code on form load?
Nov 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.