Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How Can I Sort Items In Combo Box


I Would like to display the items sorted i.e whenever I press any key it will bring the items matching the letter.
I mean it will work as index of MSDN help.

I need urgent help




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Sort Items {in Image Combo}
Hi,
for example we have many item in an Image Combo Box!
How to sort them by name ?!

Listview Sort Items
Hi,

how can I move Items in a ListView with an up and down button?

Sort List Items
Set the ListBox sorted value to true

Sort Items Numerically
hey, trying to sort items numerically, when items placed dynamically and when surpassed 10 or more the items look like this:

1
10
2
3
4
5
6
7
8
9

how to sort like this?:

1
2
3
4
5
6
7
8
9
10

thank you

Alphetical Sort Items In Combobox
Hi All,
I need to populate a combobox with the names of the files in a folder. For this purpose i have been successfully using the code given below.

Can someone modify the code such that this list appears in a alphabetical sorted manner.
Thanks,
Lonely


Code:

Private Sub ComboBox1_Change()
If Backspaced = True Or Trim(ComboBox1.Text) = "" Then
Backspaced = False
Exit Sub
End If
Dim i As Long
Dim nSel As Long
For i = 0 To ComboBox1.ListCount - 1
If InStr(1, ComboBox1.List(i), ComboBox1.Text, _
vbTextCompare) = 1 Then
'Save the SelStart property.
nSel = ComboBox1.SelStart
ComboBox1.Text = ComboBox1.List(i)
'Set the selection in the combo.
ComboBox1.SelStart = nSel
ComboBox1.SelLength = Len(ComboBox1.Text) - nSel
Exit For
End If
Next
End Sub

Private Sub ComboBox1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyBack Or KeyCode = vbKeyDelete Then
If ComboBox1.Text <> "" Then
Backspaced = True
End If
End If
End Sub

How To Auomatically Sort Items In A List View???
Hai my friends,

I have a question to ask. In the list view, it shows the headers as Name, Price, Quantity, RemainingQuantity. Now, all I need to know is that is there any way when we click on the Name header, it should sort the name list. As we see in some programs.

I hope there is a way to do it. But I dont know how . Please help me.

Darkshade

How Can I Sort The Items In A List Box That Is Filled With An Array
How can I sort the items in a list box that is filled with an array.

When I try to set the sort property to true it says I can't assign to a read only property

Also I need to be able to sort the list box alphabetically or by a user specified order that is also stored in the array.

Sort Combo Box
It was my understanding that a combo box can be sorted only in the design mode. However, this will not work for me because my combo box may contain text or numbers and if sorted, my numbers get sorted based on the equivalent characters. Any body know how to resolve this problem. I only want to sort when the combo has a text or if I can define sort method. But, it seems I can't do anything with the sort during the run time.

Thank you in advance

Sort A Combo Box
I understand that you could sort a combo box in VB only in the design mode. However, I do not want to do that because my combo box may contain a text or a number. I want to sort only when it is a text or both if I can specify a sort order. Otherwise, the numbers are sorted based on its equivalent characters. Any advise or suggestion would be helpful.

Thank you in advance

Excel Combo Sort
Hi,

I have created a user form with a combo in it that I have populated from the Excel Worksheet. The problem is that I cannot seem to be able to sort the list. In VB6 it would be Combo.Sorted = True but this does not seem to be an option in VBA.

Does anyone have any ideas??

Numerically Sort Combo Box
I need to have my combo box sort numbers in a "counting" order at runtime, but am at a loss as of how to accomplish this.
I would like my list to look like:

1
2
3
10
20

Instead of:

1
10
2
20
3

Any help would be appreciated

Changing Sort Order On Combo Box
I need to sort a Combo Box list in descending order. Currently, the list is sorted, but the lowest(and oldest) values are shown first. Over time, the list has grown to several thousand entries, but only the most recent values are worked on frequently.

Is there a way to change the sort order, perhaps through an API call? I could sort the values myself before plopping them into the Combo Box, but it would take some significant code changes.

Sort Combo (IP Addresses And Chars)
How can I get a combo to sort correctly numbers and chars.

The values are read from an mdb: SELECT * FROM table ORDER BY I_Address... combo1.addItem adoRS_AddPrLd!I_Address... example
combo1.addItem "192.168.8.222;string1;string2"
combo1.addItem "192.168.11.2;string1;string2"
combo1.addItem "192.168.4.11;string1"
combo1.addItem "192.168.1.22;string1;string2"
combo1.addItem "192.168.3.1;string1;string2;string3"

The lengh of each entry is not fixed. There are over 500 entries.

The result displayed in the combobox is:
192.168.11.2;string1;string2
192.168.1.11;string1
192.168.3.22;string1;string2
192.168.4.1;string1;string2;string3
192.168.8.222;string1;string2

It shoud be:
192.168.1.11;string1
192.168.3.22;string1;string2
192.168.4.1;string1;string2;string3
192.168.8.222;string1;string2
192.168.11.2;string1;string2




Thank you

How To Sort Combo And List Box Contents?
Hi. I am just wondering if there are any pre-defined methods for arranging the contents of a combo or a list box in alphabetical order. Or would I have to write the algorithm myself? If so, any advice on how I can write it in such a way that it won't slow down the program by too much? The contents of the list can run to as high as 100 items. TIA

Reverse Sort Order In A Combo Box? Please Help (vb6)
Hi Guys,
I am trying to list dates in a combo box.
the dates are added, year / month / day like this..

2005 10 04
2005 10 06
2005 10 05


the combo box with (Sort = true) will display them as..

2005 10 04
2005 10 05
2005 10 06

This is all well and good, except the recent dates are added the the bottom of the list, which could get excessive.
I would like to reverse the order so the most recent date comes to the top. Any help would be appreciated greatly.



Skorkpup

Word 2000: How To Sort A Combo Box
Does anyone know how I can sort an unbound combo box using Microsoft Word and VBA? In my Initialize function of my form, I am using the .AddItem method to populate my combo box. The user has the ability to add new items to the combo box. I would like to be able to sort the combo box right after the user adds a new item to the combo box. Does anyone have any code or ideas of how I can do this? Would the same apply for a List Box? Because I will eventually add this functionality later, but the Combo box is 1st priority.

Thanks.

Populate A Combo Box Using Sort Or Filter Possibly
I have a vb project that I am connecting to a Ingress II database. The combo boxes are populated. Now when I click on the add button I need a combo box for the protocol and section to be populated with more specific information. The protocol box -only one protocol number-no duplicates -Section - I need the sections to appear that go with that specific protocol only. I am out our ideas. I tried a filter in the cboSection but only got it to work on the entire project not just when add was selected. I did not get the section numbers to correspond at all yet. Here is the code.


Private Sub cboSection_Click()
  ' With cboSection
   ' ado1.Recordset.Filter = "protsect Like '" & _
    ' .List(.ListIndex) & "*'"
  'End With
End Sub


Private Sub cmdAdd_Click()

    If cmdAdd.Caption = "&Add" Then
                  'clear out fields for new record
        cboProtcode.Visible = True
        txtProtocol.Visible = False
        cboSection.Visible = True
        txtSection.Visible = False
        cmdCount.Enabled = False
       
        ado1.Recordset.AddNew
        DisableButtons 'disable navigation
        cmdSave.Enabled = False 'disable the save button till fields are filled in
        cmdAdd.Caption = "&Cancel" 'allow a cancel option
        
    Else
        ado1.Recordset.CancelUpdate 'cancel the add
        EnableButtons 'enable navigation
        cmdSave.Enabled = False 'disable the save button
        cmdAdd.Caption = "&Add" 'reset the add button
        cboProtcode.Visible = False
        txtProtocol.Visible = True
        cboSection.Visible = False
        txtSection.Visible = True
        cmdCount.Enabled = True
                
    End If

End Sub

Private Sub cmdCount_Click()
ado1.Recordset.MoveLast
MsgBox "Record Count: " & ado1.Recordset.RecordCount, vbOKOnly, "Database"
End Sub

Private Sub cboProtocol_Change()
    ' check to see if each text field has contents. If they all have
    ' contents (ie, they're not empty) enable the "Save Entry" button.
    If cboProtcode.Text <> "" And txtFinalAnylsis.Text <> "" Then
        cmdSave.Enabled = True
    Else
        cmdSave.Enabled = False
    End If
   
End Sub

Private Sub lstSection_Click()

End Sub

Private Sub txtFinalAnylsis_Change()
Call cboProtocol_Change
End Sub

Private Sub cmdDelete_Click()
    'Delete the current record
    With ado1.Recordset
        .Delete 'delete the current record
        .MoveNext 'move to the following record
        If .EOF Then 'if last record deleted
            .MovePrevious
            If .BOF Then 'if BOF and EOF true, no records remain
                MsgBox "The recordset is empty.", vbInformation, "No records"
                DisableButtons
            End If
        End If
    End With
End Sub

Private Sub Form_Load()
'fill the combo boxes
cboProtcode.Clear
cboSection.Clear
cboTest.Clear
    With ado1.Recordset
   Do Until .EOF
      If !protsect <> "" Then
        ' cboProtcode.AddItem !Protcode
         cboSection.AddItem !protsect
        End If
     '.MoveNext
    'Loop
'cboProtcode.ListIndex = 0
cboSection.ListIndex = 0
If !protcode <> "" Then
  cboProtcode.AddItem !protcode
  End If
  '.MoveNext
  'Loop
  cboProtcode.ListIndex = 0
  'fill the combo box
      If !protcode <> "" Then
      cboTest.AddItem !protcode
      End If
     .MoveNext
    Loop
  cboTest.ListIndex = 0
End With

End Sub
Private Sub cmdFirst_Click()
    'Move to first record
    ado1.Recordset.MoveFirst
End Sub

Private Sub cmdLast_Click()
    'Move to last reord
    ado1.Recordset.MoveLast
End Sub

Private Sub cmdSave_Click()
    'save the current record
    ado1.Recordset.Update
    EnableButtons
    cmdSave.Enabled = False
    cmdAdd.Caption = "&Add"
    cboProtocol.Visible = False
    cboSection.Visible = True
    cmdCount.Enabled = True
End Sub

Private Sub cmdFind_Click()
    Dim SearchCriteria

    SearchCriteria = InputBox$("Enter Protcode to be found:", "Find")
     If Trim$(SearchCriteria) <> "" Then
     ado1.Recordset.MoveFirst
      SearchCriteria = "Protcode = '" + SearchCriteria + "'"
      ado1.Recordset.Find SearchCriteria
    End If
        If ado1.Recordset.EOF Then
        MsgBox "No match found, Try again!", vbOKOnly, "Search"
        
         SearchCriteria = InputBox$("Enter Protcode to be found:", "Find")
         If Trim$(SearchCriteria) <> "" Then
       ado1.Recordset.MoveFirst
      SearchCriteria = "Protcode = '" + SearchCriteria + "'"
      ado1.Recordset.Find SearchCriteria
    End If
        End If
End Sub

Private Sub Form_Activate()
ColourFade Me
End Sub

Private Sub cmdExit_Click()
    'exit the project
    End
End Sub
Private Sub DisableButtons()
    'Disable navigation buttons
    cmdNext.Enabled = False
    cmdPrevious.Enabled = False
    cmdFirst.Enabled = False
    cmdLast.Enabled = False
    cmdDelete.Enabled = False
        
End Sub
Private Sub EnableButtons()
    'Enable navigation buttons
    cmdNext.Enabled = True
    cmdPrevious.Enabled = True
    cmdFirst.Enabled = True
    cmdLast.Enabled = True
    cmdDelete.Enabled = True
        
End Sub
Private Sub cmdNext_Click()
    'move to next record
    With ado1.Recordset
        .MoveNext
        If .EOF Then
            .MoveFirst
        End If
    End With
End Sub

Private Sub mnuFileExit_Click()
Close #1
Unload Me
End
End Sub

Private Sub cmdPrevious_Click()
    'move to previous record
    With ado1.Recordset
        .MovePrevious
        If .BOF Then
            .MoveLast
        End If
    End With
End Sub

Combo Box Add Items
I use database. I have field name "username". It contains 3 records "User1","user2" and "user3" .

I don't want "user3" were added into combo box. How I can do that?
I use code below but it add 3 user into the combo box.


Code:
adoRS.Open "SELECT * FROM pass order by id", adoConn, adOpenDynamic, adLockOptimistic
Do Until adoRS.EOF
Changepass.Combo1.AddItem adoRS.Fields("username").Value
adoRS.MoveNext
Loop

Items In A Combo Box
ok so basically heres my problem

i have an empty text box, text1.text

and a combo box

when u click the combo box it will drop down^
1
2
3
4
5
and when you click 1 i want it to appear in the text box saying:
"you have just clicked 1"

and if you click 2 i want it to say:

"you have just clicked 2"

but i dont no what the code is for actions in a combo box.

can some1 please help me!



dunno if i explained this very good:S

How To ADD ITEMS To COMBO BOX...
Hello there, VB Experts! Now I have some serious tough questions here...

How do you READ values from a file then add it into a combo box?
For EXAMPLE a file called "fonts.cmd" the value:
Arial
Fatity

Tahoma
Reci

Suicide

------------------ As you see there are spaces between the values, how do I put those values into a COMBO BOX? So, I can select the values in the COMBO BOX.



And what does vbCrLf do?
How do I use vbCrLf?

How To Add Items In Combo Box
Okay, the Title isn't specific enough but I will specify myself here.

I am making this program (well I already made it... Finished) Anyways It has a Combo box with all content and stuff, then when you click on it it will bring up texts and stuff in a text box! What I'm wondering is, if you save a File that you have edited in that txtBox(textbox) and add that file in the cboBox(combobox) so when the user clicks on that cbobox the content of that file appears in the text box. I know the Command cboBox.Additem (Whatever) but you see, when you unload the Program, that item will be gone.... and forever lost, I want it to be there permanently, forever...... How can I do this, Can anyone show me an example code?

Thanxx!

Combo Box Items
I am a VB newb and need some help.

I am just trying to create a few simple combo boxes that just show a list of data that will not change.
Over time the results selected I may use to execute other things but for now they are just for visual representation.

The code I have started works fine, but everytime I click the pull down box it keeps adding the same items over and over!!!
I want to avoid using a form and just leave it embeded withing Excel.

My code:
Private Sub Box1_change()
box1.AddItem "None"
box1.AddItem "Tx on Selected"
End Sub

Thanks

Combo Box Items
Hi everyone... I have a form on which I placed a combo box. I have coded my form so that if my user starts typing their name into the combo box's text area, it auto completes. If I have Joe and Joanne both in my list, and my user starts typing "Jo, the auto complete feature will have selected Joanne, but the next character typed is "s" (name is Joseph), how do I compare the text value with the items in the list? I thought Combo1.Item, but Item is not an available property for a combo box. So what would it be?
Code:If NOT Combo1.Text = Combo1.??? then

Happieman
a.k.a. Bill

Edited by - Happieman on 10/31/2007 12:50:28 AM

How To Sort Combo Box Item With Key Press[Unresolved]...} [Very Urgent]
I have one combo box in main form...i fed combo box with items from access database..all i want is that when i press any key(A to Z), then all the items whose name begins with the key pressed will be listed on combox.
I also want that at first it lists all the items...but when press letter 'S' (suppose), then it will show only items which name begins with letter 'S'.
Please anyone help me out with this
thankx
saracjl

Sabin Kumar Chhetri

Edited by - saracjl on 4/5/2005 4:52:27 AM

Load Combo Items From An Ini?
Hi,

I'm not sure if I'm posting this in the right place

I'm already using an ini to save the settings in my application, so is it possible to use the ini file to load my combo box items?

Maybe the KeySection could be called COMBO and then list the items... I'm not sure how to do this, or even if it's possible.

Could anyone tell me if it's possible, and if so how?

Thanks a lot, much appreciated!

Deleting Items From A Combo Box
Hi everyone, I'm pretty new to VBA so this might be silly. I have a combo box that is unbound. I add the items by reading the subdirectories in my app directory, so I'm using cbo.AddItem, how do I delete them so when I add them again I don't have repeated values? I'm used to using cbo.Clear in VB, but I don't have that property in VBA.
Thanks!

Adding Items Into A Combo Box With For/Next
Newbie problem, any help is greatly appreciated!!!

Here's what I have. I am writing a program that maintains reports for the volunteer firestation in my town. Each "User" of this program has their data stored in it's own file. (IE: If the UserID was 201 then their profile path is "App.path & "datauserinfo" & UserID & ".pfd"" making in my case the path: c:pauldenvfduserinfo201.pfd).

I am trying to use a for next loop (XasRadioLoads) to open these files one by one to get that data from them to fill in a combobox. I only have 2 users of a possible 20 configured at this point. What the loop is doing is adding 10 each of my 2 users filling up 20 spaces instead of just 2. Here is the code I am using.
---------------

On Error Resume Next
UserToVerify = 201

For XasRadioLoads = 1 To 20
Open App.Path & "datauserinfo" & UserToVerify & ".pfd" For Input As #1
Input #1, UserRadioID, UserLastName, UserFirstName, UserMI, UserAddress, UserCity, UserState, UserZIP, UserPhone, UserCellPager, UserGrantAccess, UserPassword
Close #1

combo_IC.AddItem UserRadioID & " - " & UserLastName & ", " & UserFirstName
combo_IC.Refresh
UserToVerify = UserToVerify + 1
Next XasRadioLoads

--------------------

Can anyone help me with this? THANKS A LOT!!!

Dynamic Combo Items
hi,

I need to load combo box values dynamically from a external text file

The external text file will contain 2 pieces of information DisplayName & Path seperated by a tab

App1 C:TestApp1.exe
App2 C: est2App2.exe and so on

I am trying to build a small interface that has a combo box and a Launch App button. The combo box will contain all the Diaplay Names from the external textfile and when the launch App button is clicked i use shell and call the relevant path of that combo item.

Can someone give me an idea of how this can be done?.

Removing All The Items In Combo
Hello
I added values from 1 to 50 to combo:

For x = 1 to 50

Combo.AddItem x

Next x


But when an event is triggered I want to remove these values:

For x = 1 to 50

Combo.RemoveItem x

Next x

This does not work, how should I remove all the values?

Duplicate Items In A Combo Box
Hi,

I have a combo box for which I am adding items to the drop down list with the .additem property.
I am adding items during the running of the application by the user. However, duplicate entries are being added to the combo box if a user selects one of the list items a second or more times.
Does anyone know if there is a way or maybe some code that can stop duplicate entries appearing in the drop down list.

Tanx,
Trigg.

How To Only Add Unique Items To A Combo Box.
Im making an Internet Explorer knock-off for my programming class. I am using a combobox for the address bar, so I can add sites visited into it. I only want to add unique addresses though. As of now, it adds the same addresses several times.

Any help?

Disable Combo Box Items
Is it possible to disable individual items in a combo box, if not is it possible to change the forecolor of individual items so as I can disable them through code?
Thanks for any help

Remove Combo Items
i need to remove items in a combo box that already exist in the list but im not sure how. i thought this code i wrote last night would work, but it doesnt, and i cant figure out why. any ideas?



Code:
For b = 1 To cboRecent.ListCount
'c is the array index
c = b - 1
'd is a value linked to c array index
d = cboRecent.List(c)
'nested for to find a match between d & the other items
For e = 1 To cboRecent.ListCount
f = e - 1
If cboRecent.List(f) <> d Then
'add item to list
cboRecent.AddItem (RECENTLIST)
End If
Next e
Next b

COMBO: Selecting Items
the combo is populated with


Code:
cmbWC.AddItem Format(refWC.wc & " " & refWC.desc, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")

where refwc.wc is up to 6 characters and refwc.desc is up to 20 chars.

and i want to be able to have an item selected based on refwc.wc.

help.

Assigning To Items In A Combo Box
I have a combo box in my new program, never used one before, but I managed to put 4 items into a list

each item needs a value though, heres an example of what I got:

combo1
Item1
Item2
Item3
Item4

each item in it needs a value as I said, how do I go about getting them in?

Duplicate Items In A Combo Box
I have created a quotes data base wherein i collect data from books, articles, and even articles on the internet. I use 6 different comboboxes, combobox(0) to combobox(5), to fill in the title, author, and keywords. So each time i move from one record to another or add records, i call the following procedure, so as to rewrite each of the text, combo, and richtext boxes on the form. This procedure is called "PopulateRs"

Public Sub PopulateRs(Rs As Recordset, ctlControl As Control, cntIndex As Integer)

Rs.MoveLast
Rs.MoveFirst
Do While Not Rs.EOF
Select Case cntIndex
Case 0
combobox(cntIndex).AddItem Rs!bkart_
Case 1
combobox(cntIndex).AddItem Rs!author
Case 2
combobox(cntIndex).AddItem Rs!ISBN
Case 3
combobox(cntIndex).AddItem Rs!keyword_1
Case 4
combobox(cntIndex).AddItem Rs!keyword_2
Case 5
combobox(cntIndex).AddItem Rs!keyword_3

End Select
Rs.MoveNext
Loop

End Sub


The problem that i am encountering is that i get duplicate items. If for example, i enter the author name of "Lee, Dorothy", the first time this is no problem. The second time when i choose this name from the list, it is duplicated in the list of items. What should i do to correct this problem of duplicate entries?

persub

Switching Items In Combo Box
Good Afternoon All.
I am trying to code a "Select" function in my application that will allow the user to select items by Product ID or by Product Description.
The main form has a combo box set up that currently displays the Product description Information.
I am struggling to work out how to code my menu items "Select > by Product ID" so that it changes this combo box to display the Prodict ID's from the tbl, and also fill the text boxes with the appropriate information.
"Select > by Product Description" should change the combo box to display the product description info etc.

I have attached the current project so that hopefully seeing how I currently have everything set up will make it easier for you to assist me.
I am working in Visual Studio 2005.

Many Many thanks in advance.

Edit by Shurik12:
Please no binaries in attachments

Adding Items To Combo
Is there a way where I can read from a file and add each line of the file to a combo control?

Duplicate Items In Combo Box
hello .. i have a combo box that is load from a database field. what i want to do is when i select an item to display a description in a textbox.. It displays what i want to display fine, but everytime i click on the combo box to selected an item it duplicates the item. I tried the change event but doesn't display anything in the textbox..

Private Sub cboPrice_Click()

If Me.cboPrice.ListIndex = 0 Then
Call showPrice(Me, 1)
Else
Call showPrice(Me, 2)
End If


End Sub

thanx

Loading Items Into A Combo Box From TXT
Hey,
I have a combo box, also have a txt file containing a username and other data, I want to load the first value (delimited by "~") into the compbo box.
the first bit of data will be the username...
I know how to open and read the file, but not how to get the first value into the combo box in a list form
and then when something from the list is selected but the corresponding data into the fields. Hope that makes sence, If you could point me in the right direction that would be great!
Thanks

Load Combo Box Items Once
I've got a list of around 5000 share codes that I display in a combo box which the user selects 1. As there are around 5000 items to add it takes 3/4 seconds for them all to load and it looks like my app has frozen...

My question...is it possible to load all the items into a combobox when my app loads (I have a splash screen) and then display that combo box which already has the share codes added when I load any form that needs to display the list?

Hope that makes sence.

Need=&gt;comparing Items From Combo Box
sample codes could be a great help..tnx

Combo Box...disabling Items
is there a way i can disable items in a combo box once they have been selected.
I know you can remove them but this messes with the listindex values?

i had been removing them all along but it wont work as it changes the value of the string im assigning to it.

heres what i had:
If cboLocation.ListIndex = 0 Then
stLocation = "GCS1"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 1 Then
stLocation = "GCS2"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 2 Then
stLocation = "GCS3"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 3 Then
stLocation = "GCS4"
cboLocation.RemoveItem (itemIndex)
ElseIf cboLocation.ListIndex = 4 Then
stLocation = "GCS5"
cboLocation.RemoveItem (itemIndex)

etc etc

Adding Items To Combo Box
Hi,

are there any way (code or other special control) which makes the Combo box control able to add new items during Runtime if this item is not in the combo box list, complete the text if the first letters typed in the combo Box are included in one of the list and so on ...
may any code can do it.... pleaase prode me with the code.

Thanx

Adding Items To Combo
How would I insert more text into the combo, that way when i click the / button, it'll have more choices instead of just the header

Can Items Within A Combo Box Expand?
Good afternoon!

I'm making a fairly simple database with Access 97 and VB6. One of the combo boxes in the database lets you select an e-mail program from a list. Right now I have

"Outlook"
"Outlook Express"
"Netscape Mail"
etc

What I would like to be able to do though, is when I put my mouse on "Outlook", for example, then a new menu opens up right next to it with a list of versions to choose from. So it would be like

"Outlook" -> "97"
"2000"
"2002"

etc.

Things like that are easy to do with the Menu Editor, but can a simple combo box expand like that? or would I have to make my own activex control?

here's an example of what I mean by an expanding menu. ^_^



thanks!

Add Items To Combo Box In Word Doc
I am setting up a template for staff to use & find that the basic word forms combo boxes are too limited, so I am trying to learn how to add an ActiveX combo box instead. I know how to go into Word 2000, drag a combo box from the control toolbar onto the template where I want it to be located & then go into the coding area - but I am not finding the right code to add items so that they list correctly. After the sub combobox1_change() line I use the additem method, but find that if I don't add the right items the first time, the list either repeats or holds old values when I go in to change items later or keeps adding values as they are selected each time.... There are about 5 fields out of about 25 that I need these combo boxes for on the template, the rest can just be filled in by the worker. I am not using a userform, just adding the box to the template - is there a better way to try to do this?

How To Save Items In A Combo Box
Alright, here is my predicamint... I have a a combo box, and i want to save items to a file. Lets say it has 4 itmems in it, but it could have more or less at any given time... (the combo box name is cmbgoods)

Here is how the save so far is set up:


VB Code:
Private Sub mnuSave_Click()' this routine saves the game to disk. ' set up the CommDialog controlOptions.CommonDialog1.DialogTitle = "Save Game As" Options.CommonDialog1.FileName = "SaveGame.tsv" Options.CommonDialog1.DefaultExt = "tsv" Options.CommonDialog1.Filter = "Saved Games (*.tsv)|*.tsv|All Files (*.*)|*.*" Options.CommonDialog1.ShowSave  lFileName$ = Options.CommonDialog1.FileName If InStr(lFileName$, "") = 0 Then Exit Sub  Open lFileName$ For Output As #1' output a headerWrite #1, Char.Name & " Saved Game"' write out the character statsWrite #1, Char.Name' write out the itmesWrite #1, 'What goes he so it would save all the items in the combo box End Sub


If you need any other info that would help you out, just reply. Thx

~$uper-$tar

Adding Items To Combo
I would like to add some items in a combo box
I have the list in a string
E.G.

mystring ="a|b|c|d"

each item separated by "|"

Is there a way using a single call to a method in combo I can add this string to combo rather than calling addItem method in a for loop . This is because I have a lot of items to be added and it takes a considerable amount of time to loop through and add each items.

Currently I am using this method
Dim arrValue
arrValue = split(mystring,"|)
For intIdx = 0 To UBound(arrValue )
cmbValue.AddItem arrValue(intIdx)
next

But cmbValue.AddItem (mystring ) doesnt work.

Thanks in advance

Copyright 2005-08 www.BigResource.com, All rights reserved