Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

? Removing 'Selected Text' Highlight in Combo Box ?

Status
Not open for further replies.

suel

Programmer
May 9, 2002
13
GB
I have a form containing a Combo Box (cboYear).
On Form Load I fill the combo box . Then using a retrieved recordset (vrs) I put the recordset value into the combo. ie

Code:
cboyear.listindex = vrs!syear

This works fine, except the text is highlighted
Is ther some way to turn this off, until the user tries to select an alternative value ??

Thanks


 
Option Explicit

Private Sub Form_Load()
Combo1.AddItem "one"
Combo1.AddItem "two"
Combo1.AddItem "three"

Combo1.ListIndex = Combo1.NewIndex
Show ' you need this (at least I did)
Combo1.SelStart = 0
End Sub
 
To have nothing selected in a standard combo just use:
Code:
Combo1.ListIndex = -1
Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
I designed it full screen not realizing about resolution settings, etc. It is a one page purchase order form. I can break it into two or more forms--one for vendor's address, one for ship to address, etc., but don't know how I would keep that data together and then have a "preview" of the completed form at the end of the program for viewing before printing (which is something I am still working on too).
 
Is it getting harder to follow threads? or am I getting old? Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top