?
Solved

Move Item To Top Of ComboBox

Posted on 2002-05-02
10
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
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 600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses

765 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