Solved

Move Item To Top Of ComboBox

Posted on 2002-05-02
10
226 Views
Last Modified: 2008-02-26
I am working with a combobox that is sorted.  I want to add an item after the sorted items are entered that will be at the top of the combobox... like NONE.

I don't want to use a space or an underscore to move it to the top... anyway to do this???

Thanks!
0
Comment
Question by:MTroutwine
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6986163
No.  The only other way would be for you to maintain the sorted items and leave the Sort property = False.

Anthony
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6986195
Indeed, sort the items first and then add them to the combo box is the only way of doing this.
0
 
LVL 18

Expert Comment

by:deighton
ID: 6986226
'with.sorted is true
   
    Combo1.AddItem "Bunk"
    Combo1.AddItem "Abunk"
    Combo1.AddItem "NONE", 0
0
 
LVL 18

Expert Comment

by:deighton
ID: 6986230
note that your combo has .sorted=true in properties.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6986239
deighton,

You are right.  I overlooked that solution.

Anthony
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6986392
i am late!
0
 
LVL 18

Expert Comment

by:deighton
ID: 6986412
..so did I, it was an accident, I was trying to change sorted to .false then add it to the top - you can't change to .false, but adding it to the top still seems to work.
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 150 total points
ID: 6986507
Alternately you can do what Microsoft did ni its properties listing (with name, custom, etc.) and surround it with parentheses:  "(None)"

This will also reinforce the idea that this is not part of the dataset.
0
 
LVL 3

Author Comment

by:MTroutwine
ID: 7016464
Sorry for the delay on this... I used your idea of "(None)".  Works fine now.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7016714
Glad you liked the idea (even if it came from Microsoft), and thanks for the "A" grade.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now