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

ComboBox MatchEntry

When I used ComboBoxes with VBA in Office 2000 I had a event called 'MatchEntry'.
This event will AutoComplete the users input.

Unfortunately I do miss this event in VB6.

Does anybody knows if this function is also available (maybe with another name).

Thanks for help

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Can someone tell me what Matchentry in a Ado Datalist does doing?
I don't know what it is.


Forms2.0, VB, MatchEntry

I have been working with combo box like you do. VB combo box cannot do as Excel or Access ones. I do not know how to do as I want it to behave as in Excel and Access.

I once thought of making an OCX for my need of combo box, then I gave it up, for the business I am working with does not need it as a priority one. I am happy to know someone doing it.

Forms2.0, VB, MatchEntry
Ok I think I have a pretty curly one for the forum:

I have a combobox on an Excel form, populated with values like "New York, New Hampshire, New England, Nevada, North Carolina"

when I show the form, and begin typing into the combo, an entry appears containing the letters i have typed. This makes it very easy to get "New Hampshire" by typing the letters "new h" - or "Nevada" by typing "nev" into the combo.

I am developing a sister app in pure VB (VB6), which also has comboboxes (I have tried 3 types, the DataCombo, Combo1 (vb std), and Combobox1 (Forms 2.0) - the only problem is the entry matching is NOT HAPPENING!!! (yes they ARE hooked up okay with datasource and ARE populated with the values i want)

what have I missed?

Listbox Matchentry
Anybody know why my listbox matchentry property does not take effect until I click on an item in the list? If I don't click on an item but simply type a letter, nothing happens; ie., next matching item is not selected. Thanks.

VB Combo Does Not Support MatchEntry?

As VBAer i used to work with combos that supported the matchentry property. While i tried to place on my VB form the combo control, i noticed that there was no such property like that.
Neither the matchrequired property. Is that true or looking at a wrong direction?

Thank you

Datalist/Datagrid MatchEntry

How do I get MatchEntry to work with a datalist control, being updated by a datagrid field. It works with a datacombo box, but I want to do it with a datalist box, and bring the selected field to the top of the datalist. This is basically where I'm at:

Set DataGrid1.DataSource = Adodc1
Set DataList1.DataSource = Adodc2

DataList1.MatchEntry = dblExtendedMatching

With DataList1
Set .DataSource = Adodc2
Set .RowSource = Adodc2
.ListField = "field2"
end with

DataList1.Text = DataGrid1.Text

Thanx in anticipation of your assistance.


Combobox: Automatch Item, Select In Other Combobox, Remove From Both
I have 2 comboboxes and a listbox. I want the user to select an item from one combo, with then matches the item to its corresponding item in the 2nd combo, then add both to a list box. The user can either select from the 1st combo or from the 2nd...either one will match to the corresponding item in the other. Both comboboxes also have to be autocompleting. Once the selection is added to the listbox, the user can remove it which will delete the item from the list and add them back into the appropriate comboboxes. I have this working except for one thing.

When autocompleting, if the user types in what they want and its found and they hit ENTER, I am getting an error when trying to remove the item from the combos. It tells me the index is invalid and sure enough, when I check what the index is, its -1. It seems that the user isn't selecting an item in the combo even though its matched.

This is what I tried. It works if an item is clicked or chosen by pressing the up/down arrows. It also works if they type what they want, its matched, then they press up/down or some other number but will NOT work if they just type it, its found and they hit enter:

Private Sub cmdAdd_Click()
List1.AddItem cmbo(0).Text & " " & cmbo(1).Text

cmbo(0).RemoveItem (cmbo(0).ListIndex)
cmbo(1).RemoveItem (cmbo(1).ListIndex)

End Sub

Oddly, if I put the opposite combo item to be deleted, it, if I just selected something from combo 1, the following works:

Private Sub cmdAdd_Click()
List1.AddItem cmbo(0).Text & " " & cmbo(1).Text

cmbo(0).RemoveItem (cmbo(1).ListIndex)
cmbo(1).RemoveItem (cmbo(1).ListIndex)

End Sub

Any ideas anyone? Perhaps I need to post the function I use for autocompleting? Let me know please...

Text In Combobox Appears In Combobox Field
Anyone know how to select the text in a combobox when the user types in its field? For example, if the use types Fr in the combobox field , the selected item would be France and would appear in the combobox field from a list say consisting of [Spain, Portugal, France].

[Solved] How To Change The Content Of An Combobox With An Other Combobox
Hi, I'm new,
but I already have a question:

How do I Change the content of an combobox by choosing the things in an other combobox?

For example, there are two comboboxes. They are both about color.
In the first combobox you select a color like purple, green and blue.
Once you've selected blue, the other combobox comes active, and you can select light blue, normal blue or dark blue.

What I'm creating is a program "for restaurants". It has two comboboxes. In the first combobox you choose the "Type or order", like noodles, rice or pizza. After you've selected something, an other combobox becomes active. If you've selected pizza in the first combobox, then the content of the second one is like: Pizza Hawaii, Pizza al tonno, Pizza BBQ. But, if I selected rice in the first combobox, then the second combobox should give the options "Rice with vegetables" and "Rice with chicken".

This is the code I've written:

Private Sub CommandButton1_Click()
lstOrderlist.AddItem cmbGerecht
End Sub

Private Sub CommandButton2_Click()
End Sub

Private Sub UserForm_Initialize()
cmbSoort.AddItem "Noodles"
cmbSoort.AddItem "Fried rice"
cmbSoort.AddItem "Pizza"

If cmbSoort = Empty Then
cmbOrder.AddItem ""

ElseIf cmbSort = "Noodles" Then
cmbOrder.AddItem "Noodles with chicken"
cmbOrder.AddItem "Noodles with beef"
cmbOrder.AddItem "Noodles with grease"

ElseIf cmbSort = "Fried rice" Then
cmbOrder.AddItem "Rice with chicken"
cmbOrder.AddItem "Rice with beef"
cmbOrder.AddItem "Rice with grease"

ElseIf cmbSort = "Pizza" Then
cmbOrder.AddItem "Pizza Al Tonno"
cmbOrder.AddItem "Pizza Hawaii"

End If
End Sub

Somehow, the second combobox remains empty.
Can someone tell me what I'm doing wrong??

BTW, to make things clear: cmbSoort is the "first combobox" from the example, and cmbGerecht is the second one.

Picture of the program with the names of the comboboxes (some words are in Dutch language):

The word-document (I created it with VBA in word):
(sorry I don't know any other host)

Soo....I hope I'm being clear. Can someone help me out with this please? I really need to figure this out quick

Edit: The combobox problem is solved now, but not I've encountered 2 other things I need to solve, them it's done. See last reply.

VB6 Combobox Behave Like VB3 Combobox When Deleting Items
I have a fragment of combobox code from a VB3 legacy application, which isn't working the same when ported over to VB6.

I have a combobox with the 'Dropdown List' style, to which I've added several items. In VB6 if the combobox dropdown list is displayed, and the delete button is pressed, the combobox defaults to the original value. In VB3, the combobox items are deselected (ie. combo1.ListIndex = -1).

Here's the code -

VB Code:
Private Sub Form_Load()    Combo1.AddItem "Sample1"    Combo1.AddItem "Sample2"    Combo1.AddItem "Sample3"    Combo1.AddItem "Sample4"    Combo1.AddItem "Sample5"        Combo1.ListIndex = 0End Sub Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)    If KeyCode = KEY_DELETE Then        Combo1.ListIndex = -1    End IfEnd Sub

So I select an item from the first combobox, ensuring that the dropdown list is displayed -

While the dropdown list is displayed, I press the delete key -

I then select another control, so the focus is lost from the combobox -

Notice in the above picture, that instead of a blank selection I get the original item instead. In VB3, performing these steps results in a blank selection instead.

Without changing the Style to 'Dropdown Combo', or removing the deletion function, is there a way I can get this program to behave the same way in VB6 as it does in VB3?

How To Link A Combobox From A Database To A Combobox On A Form.
Goodday There,

I have a problem with linking a dropdown combobox from the database to a dropdown combobox in a form, Please help and I'm using access database by the way.

Thank you in advance...


ComboBox - Displaying Database Values In A ComboBox
I am trying to insert values from a database into a combo box.

I have linked the datacontrol to the combo box and values from the database are displayed within the combox box. However can only be navigated using the data control. I would like the values to be listed within the drop down list of the combo box.

Can anyone help pls?!?!


Filling A Combobox From Database But I Don't Want Duplicates In Th Combobox.
I want to output the contents of a database field (ms access) to a combobox but the field has many duplicates that I wish not to display. I just want one of each. Thanks

ComboBox Contents Are Longer Than The Size Of The ComboBox
My comboBox contents are longer than the size of the comboBox, how can i make the content to show when pointed by the mouce, so that the user can read the whole string and make selectin


Filling A ComboBox Depending On Another ComboBox

I want to fill a Combobox (cmb2) dependent on what the user has chosen in a first ComboBox (cmb1).

The first combobox ist based on a table, and the second combobox shall be filled with lines from another table, where only the lines are chosen that are relevant, fx:

table for cmb1:

Table fro where you choose the rows for cmb2:

A Boston
A Washington
A Baltimore
B Chicago
B Miami
C San Francisco
D Miami
D New York
D Los Angeles
D Las vegas

If the user chooses "A" in cmb1, in cmb2 shuld there so be only rows from the second table, where the first column is A.

Is there anybody out there who knows a solution?

Thank you very much!!

Combobox -- Database, Selection In Combobox
I am confused, and i am hopping that i write my problem acurately

I have combo boxes, which are filled from Data from the database when loading the form, each combobox filled with different tables. Lets assume each Table has TWO fileds 1. Code 2. Name. And I filled Combobox with "Name" filed values. In some Table "Code" is Integer/Number and in some tables it is "Text" filed.

Now what i actually want to do are following
1. I say to combobox to select/display "Name" of "Code" = 51, or "Code" = "AC01244"

2. When user select any Name form Combobox I get "Code" correspond to that "Name"

I try the following code but i could not resolved fully and specially for "Code" when it is Text.

VB Code:
' in Load form function     ' Text 0001    m_strSQL = "SELECT * FROM Programs ORDER BY code"    m_rsCommon.Open m_strSQL, m_conDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText    If m_rsCommon.RecordCount > 0 Then        m_rsCommon.MoveFirst        For iLoop = 1 To m_rsCommon.RecordCount            'm_rsCommon.Fields ("code")            cmbPrograms.AddItem m_rsCommon.Fields("Name")            cmbPrograms.ItemData(cmbPrograms.NewIndex) = m_rsCommon.Fields("code")            m_rsCommon.MoveNext        Next    End If    m_rsCommon.Close     ' Text AC030001    m_strSQL = "SELECT * FROM Accounts ORDER BY AcCode"    m_rsCommon.Open m_strSQL, m_conDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText    If m_rsCommon.RecordCount > 0 Then        m_rsCommon.MoveFirst        For iLoop = 1 To m_rsCommon.RecordCount            'm_rsCommon.Fields ("AcCode")            cmbAccounts.AddItem m_rsCommon.Fields("AcName")'            cmbAccounts.ItemData(cmbAccounts.NewIndex) = m_rsCommon.Fields("AcCode")            m_rsCommon.MoveNext        Next    End If    m_rsCommon.Close     ' Number    m_strSQL = "SELECT * FROM ROs ORDER BY EntryNo"    m_rsCommon.Open m_strSQL, m_conDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText    If m_rsCommon.RecordCount > 0 Then        m_rsCommon.MoveFirst        For iLoop = 1 To m_rsCommon.RecordCount            'm_rsCommon.Fields ("EntryNo")            cmbROs.AddItem m_rsCommon.Fields("RO_Details")            cmbROs.ItemData(cmbROs.NewIndex) = m_rsCommon.Fields("EntryNo")            m_rsCommon.MoveNext        Next    End If    m_rsCommon.Close

VB Code:
' Select Name in Combobox according to their/passing Code VAluesPrivate Sub Command2_Click()'    cmbPrograms.ListIndex = (cmbPrograms.ItemData(73))'    cmbAccounts.ListIndex = (cmbAccounts.ItemData("AC00254"))    cmbROs.ListIndex = (cmbROs.ItemData(4360))End Sub ' Display Selected "Code" Private Sub Command1_Click()'    Debug.Print cmbPrograms.ItemData(cmbPrograms.ListIndex) 'Dispaly 77 even i passed 73    Debug.Print cmbAccounts.ItemData(cmbAccounts.ListIndex)     Debug.Print cmbROs.ItemData(cmbROs.ListIndex) ' Display 4706 even i passed 4360End Sub

I hope i am able to clear my problem

I am really looking for answere.... please give me any tip, example to overcome this problem

Thank to all in advance...

One Combobox Relies On Another Combobox
still no solution here. i have two comboboxes, the first one uses a rowsource and gets a list of the tables and works beautifully, now the 2nd combobox is suppose to get the list of fields from the table chosen in the 1st box. Now if i hard code a name of a table in my code i get a list of fields, so i know the algorithm works properly, but the first box doesn't seem to be in scope. i tried combobox1 and combobox1.text. the 2nd combo is also a rowsource - is that my problem? i dun know of any other way to go about it, so here is my code and if u know of another way, i'd love some advice. or maybe just a way to make the first combobox global?

Option Compare Database
Option Explicit

Function ListFields(fld As Control, id As Variant, _
row As Variant, col As Variant, code As Variant) As Variant

Dim dbs As Database
Dim dbfield As Field
Dim tdf As TableDef
Static strFields(20) As String
Static cntr As Integer

Select Case code
Case acLBInitialize
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("Contacts")
cntr = 0
For Each dbfield In tdf.Fields
strFields(cntr) = dbfield.Name
cntr = cntr + 1
Next dbfield
ListFields = cntr
Case acLBOpen
ListFields = Timer
Case acLBGetRowCount
ListFields = cntr
Case acLBGetColumnCount
ListFields = 1
Case acLBGetColumnWidth
ListFields = -1
Case acLBGetValue
ListFields = strFields(row)
Case acLBGetFormat
Case acLBEnd
Erase strFields
End Select
End Function

Combobox Affecting Another Combobox.
Hi guys, I am trying to create a column of dropdownlists and someone in another forum said I just have to just a combobox to do it. What happens is these comboboxes will have 2 values(or choices) inside them. The choice of the values inside the other comboboxes will change depending on the choice the user chooses for the first combobox.

As this is new to me I am trying it step by step by creating the combobox first.
I set the style to 2 so that it becomes a dropdown adn the user will not be able to input anything inside.

However, I can't input anything inside the Itemdata or List. Same goes for the text.

I found that the text can be changed is 0 is chosen for the STYLE but this is not what I need as the user will then be able to input values inside.

So my question at this point is how do I put a list of words or values inside the combobox?

ComboBox Help

I have a combo box which are populated with info e.g.
cboSample.Additem "blah blah"
cboSample.Additem "yo yo yo"

My inquiry is that when I press the down arrow button of the combo box, some of the text string as stated in the additem property can't be viewed in full.

The only thing that I can see the whole string is to adjust the width of the combobox?? Is there another way wherein when I press the combobox button, the drop-down list will auto adjust the width that corresponds to the widest string.

Need you suggestions.


on one of my forms the comboboxes are all highlighted when the form loads - I'm not sure why this has happened or how to stop it. I have other forms with data populated in the same way where I don't have this problem - any ideas?

To Combobox Or Not To Combobox?
im searching for something from which i even dont know if its vba or if its implemented in excel otherwise

what im searching for is:
if you click on a cell a dropdownlist(combobox) appears so that you can choose an entry and if you leave the cell activating another or so the combo disappears

i tried something like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheets("stammblatt").Range("k19").Activate = True Then
ComboBox1.Visible = True
End If

If Sheets("stammblatt").Range("k19").Deactivate = True Then
ComboBox1.Visible = False
End If
End Sub

but it doesnt work the cursers jump automatically to "k19" so that i cannot select another cell
and i think this isnt what im searching for its good for a few cells but not if you need lets say 100 in one sheet
is there an easier way?

please help

I've got a database done in Access, and i passed it's tables to v.b trough Visual data manager. In access i had a combobox recieving the values of a field in another form. So that when you introduced in the textbox a value it would save that value in the textbox and in the combobox.
Now, i don't know how to do that in visual basic. And that's where i need help.

How can I get numbers from a table and load this numbers in a combobox....


How can I relate an Item to another Item in a distincts combo boxes?

Someone PLEASE Help Me W/ This Combobox
i've posted this a couple times and no one ever seems to be able to help me, so here is my last try. i'll post the code and the types i've tried already and the problem that i'm here's what i'm trying to do:

I want to have two combo boxes on a form that add and remove fields from a table. now the first combo box is using a rowsource to a module....and it gets the names of all the tables in the database......and it works fine.... now after i select a table name from that box, i want the 2nd box to list all the names of the fields in that table. and that's where my problem is. now here's the code that i use for that rowsource module and if i hardcode a table's name it works fine.....but i try to stick the first combobox in there i get an error....i've tried just comboTable, comboTable.Text, comboTable.Value......nothing here's that code:

'Function ListFields(fld As Control, id As Variant, _
' row As Variant, col As Variant, code As Variant) As Variant
' Dim dbs As Database
' Dim dbfield As Field
' Dim tdf As TableDef
' Dim frm As Form
' Static strFields(20) As String
' Static cntr As Integer
' Set frm = "Edit Form"
' Select Case code
' Case acLBInitialize
' Set dbs = CurrentDb
' Set tdf = dbs.TableDefs("Contacts")
' cntr = 0
' For Each dbfield In tdf.Fields
' strFields(cntr) = dbfield.Name
' cntr = cntr + 1
' Next dbfield
' ListFields = cntr
' Case acLBOpen
' ListFields = Timer
' Case acLBGetRowCount
' ListFields = cntr
' Case acLBGetColumnCount
' ListFields = 1
' Case acLBGetColumnWidth
' ListFields = -1
' Case acLBGetValue
' ListFields = strFields(row)
' Case acLBGetFormat
' Case acLBEnd
' Erase strFields
' End Select
'End Function

and then i tried it this the 1st combobox's afterupdate field.....

Private Sub comboTable_AfterUpdate()
Dim cbo As ComboBox
Dim tbl As TableDefs
Dim fld As Field
Dim dbs As Database
Dim strValue As String

Set tbl = dbs.TableDefs("Contacts")
Set cbo = comboField

cbo.RowSourceType = "Value List"
cbo.RowSource = ""
For Each fld In tbl
cbo.RowSource = cbo.RowSource & "'" & fld.Name & "';"
End Sub

and i'm getting no where here either.....SOMEONE PLEASE HELP ME..........*sniffle* is really frustrating and i've been trying for weeks to get this to work. if any can fix this.....i can repay u....i have lots of stuff......

I need to clear a combobox which is filled with 200 items. And right after the combo is cleared the combo is refilled. After refilling the combobox an error "overload" occurs.

How can i clear the combobox on a proper manner.
A piece of the code:


'Clear the combobox

'Get all items
Set result = Gegevens.QrySelect(fileKKS, qry)

'initialiseer teller
i = 0

'Combobox refill
Do While (result.EOF = False)

I am making a combobox that has a font select in it and was wondering is there a way to automaticly select a item in a combobox while its style is 2 - Dropdown List.I would like it to load the last known font that has been set into registry when the Form Loads.

Please Help Combobox
if i have a combo box with a choise of THREE, FIVE, EIGHT OR TWELVE, is there any code that if say THREE is selected, when the second combo box is used it will display a range of values specific to THREE, if FIVE is used the second box displays a range of values specific to FIVE, etc

the combo boxes are on a vba user form, is there an example of the code that will populate combo box 1 from a range on a seperate sheet, then depending on combo 1 selection, populate combo box 2 with a range 1,2,3,or 4. I have been searching for ages for an example i can modify but to no avail.

this dosent work

Private Sub ComboBox2_Change()

If ComboBox1.TEXT = "3" Then
ComboBox2.RowSource = "SHEET1!1"

ElseIf ComboBox1.TEXT = "5" Then
ComboBox2.RowSource = "SHEET1!2"

ElseIf ComboBox1.TEXT = "8" Then
ComboBox2.RowSource = "SHEET1!3"

ElseIf ComboBox1.TEXT = "12" Then
ComboBox2.RowSource = "SHEET1!4"

End If

End Sub


I am adding items to a combobox and have ran one slight problem. When the list is added and the combobox is selected, the list only shows one entry at a time with a small scroll bar (toggle buttons) to view each of the other entries individually. I would like each entry to list on each line of the combobox. I have checked the properties window and I cannot find the solution. I have attached screenshots.

Any Ideas?


For/Next & ComboBox

I need assistance with a portion of code that isn't working too well for me. I am adding items into multiple ComboBoxes using a For/Next procedure.

For intX = 1 to 5
UserForm1.Combobox(intX).Additem = strNM

You cannot loop through the Comboboxes like this because they are not defined. Does anyone have a clue as to how this can be done?


Combobox Id' There A Better Way?
Hey all,

I have this excel sheet containing 6 different combo boxes with a naming scheme that follows:

combobox1a_, combobox1b_,..., combobox_1f

when excel adds a combobox to the sheet it uses the scheme:

combobox1_, combobox2_,..., combobox6_

I need to repeat this set of 6 combo boxes about 150 times on a single sheet:

combobox1a_, combobox1b_,..., combobox_1f
combobox2a_, combobox2b_,..., combobox_2f
combobox3a_, combobox3b_,..., combobox_3f

and hopefully be able to copy this code exactly how it is to another sheet in the same file.

1. Is there a more efficient way of doing this?
2. Is there a way to copy these boxes with my naming scheme without having to rename each box all over again?


Combobox Help.
i have combobox 'A' and combobox 'B', with combobox 'B' being any of 9 comboboxes. I'd like for every item in the 'A' to open the correct 'B'.


combobox a items:

if comboboxitem 91 open = true then

open combobox 91

else if comboboxitem 605 open = true then

open combobox 605


open combobox 405

end if

i'm not at home with the exact coding right now, but that's a rough idea of what i'm trying to accomplish. i've gone through different sites and tried to get information, but i have not been successful in completeing this combbox. also, how do i add elements in 'A' ? do i do it in the coding section, or can i do it from the properties menu, or does either way suffice?


ComboBox Help?
Gday all,
New poster here. First off, I'd like to say hello to Mum and Dad and all that. Now, down to business.

At the moment, my ITP class is using Visual Basic and we are doing an outcome (Exam) on it. Now, it'd be pretty neat if I could get the combo box to allow a few things.

First. Is there any way I can get the first item in a combobox (All the items are being imported from a .txt file) to actually appear there by default when I run the program so that there is always one option in the combo box? Because at the moment, when I run the program all that appears in there til I drop the list down is highlighted blank. I'm not using the combo box to type anything in so I don't need blank space.

Second. Is there any way I could possibly make something visible using the combo box. Say when one user 'Joe Blogs' is selected and they type in the password, because it says 'Joe Blogs' in the combo box, could I also make sensitive buttons such as a Employee Names/Address button appear which wouldn't appear for a normal user? I've already got the password stuff in place and working OK.

If anyone or anybody could give me a hand with these things, I will be very thankfull. Its been giving me trouble for days.

Owen (Trainfreak) From Australia.

i was wondering if anyone can help me out?what im trying to do is if my combobox = test then my label will = test thanks...

Need Some Help (ComboBox)
Hello everyone! I started making a simple program that will work just like the Notebook. But i have some problems that I am not able to solve at this point. So here is the problem:

I have a Combo Box and a Text Box right beside each other. When a User picks something from a ComboBox, it should display(in the textbox) this Item's specific describtion. For Example, If a User picks "Chicken" It will display the following (From the File named Chicken.txt) in the TextBox "Chicken - a small domestic animal...". When a program starts it loads Items into the Combo Box. Here is the code I used:

Private Sub Form1_Load()
Dim FF as Integer
Dim Line1 as String
FF = FreeFile()
Open "...Items.txt" for Input as #FF

Do Until EOF(#FF)
Line Input #FF, Line1
cmbCombo1.AddItem Line1

End Sub

So it loaded the Items into the combo box, but then...How do I make that the program will recognize which Item was selected? Coz it loads them Line by Line, and If, for example, there were 50 Items in the Combo Box, How will the program know what Item Describtion it should represent?

If you know any easier(or better) way of solving this kinda problem, plz post here. Thank You!

Thanks, Your Help will be Highly Apreciated!


Help On Combobox
Hi ,
Below is my old design (in green) where I used some option buttons to allow user to select the meters they wanna use.
If OptMeter1.Value = True Then
plmadd = 1
End If
If OptMeter2.Value = True Then
plmadd = 2
End If
but I wanna switch to using a combobo instead but now I encounter a problem below

I have a combobox with 4 items (dropdown list)

my code:
Private Sub Form_Load()
Dim plmadd as Integer

Combo1.AddItem "Energy Meter 1"
Combo1.AddItem "Energy Meter 2"
Combo1.AddItem "Energy Meter 3"
Combo1.AddItem "Energy Meter 4"

"codes missing"
End Sub

what I need to do is to assign a integer value to a variable called plmadd when anyone of the meters is selected. That's to say if I select Energy Meter 1 from the dropdown list, i will do this -> plmadd = 1
But I have no idea on how to do this, any advice?

Hey guys i usually use this to clean my combobox:

combobox1.text = ""
but it get to much work when u need to clean more than 30 of that.. how should i do to clean every combobox at my sheet ?

I have a Combobox which values refers to several colums

"Description, Partnumber and Price"
TextColumn = 1 '
When I select a component in my Combobox1 witch has Description, Partnumber and Price as values,
I would like to define where and in witch excel sheet values
from this selection are going to be stored.


Cells(16, 2) = combobox1.Text'Inserting Description into Sheet1
Cells(17, 2) = combobox1.Text'Inserting Partnumber into Sheet1
Cells(18, 2) = combobox1.Text'Inserting Price into Sheet1

Grateful for some help here :-)

Help With ComboBox
Hello Everyone, I am just getting started with Visual Basic and have a simple question. I made a ComboBox and added a few items to it. I was wondering if anyone could help me with being able to select an item from the ComboBox and have some text, or a definition, of what the item is read out on a label or a text box. I'm very new so please any help is appreciated. Thanks

We have a combo box with the following List :
How to remove one of them, for example "Second" ?

Help With ComboBox
Hello. I found this code on the net but I'm having problems removing some fetures and keeping it functional.

1. I need the age textbox gone
2. I need the checkbox gone

Can this be done? If so how?

Here's the link for the code. Download

Thank you in advance and have a great day.

ComboBox Help
I'm New To This Game So Bear With Me Please.

I'll Try To Explain .......

I'm Using A ComboBox 2 Trigger A Query & Produce MsgBox Outputs

Its Set 2 a Click Event.

Thing is , I Need 2 Make The Selection Twice Before The Query Is Triggered!

Its A Pain In The Arse & Screwing Up The MsgBox's.

Does This Make Sense To Anyone.


Is there other way to fill the combobox without using a loop? Cosider 14,000 record ids...


About ComboBox
i am using a "TextBox" to additem into a comboBox.
The comboBox allowed to add or delet a list.
Final, when the button Ok is click
need to store all the combobox of the list into an array,
How to do it??
Thanks for your help!!

hi again.. i have a combobox and add for example.. "1" in the combobox.. how do i make it like.. when i click on 1.. it will load another form?


I have a simple question about comboboxes.

I have populated a combobox using a resultset. During the lost focus on the combobox, the combo1.text becomes blank. Why does this happens?


Hey I have a problem when ever I click on a combobox which grabs the information from a file, it adds the same value over and over again. So two records would appear and when I click on the dropdown of the combobox, it will add the record once again. Basically it keeps on duplicating the record selection on the combobox. Need help for this project. thanks to all that help. I appreciate it.

How To Use ComboBox??
Hello there,
I have a very simple question but have no idea how to do this because I have never used VB before.. I've been going through some of the books and search in the web.. but fail to find and answer to my simple problem here..

i have a combo box with style = 3, a command button and a serial comport
Public CommandIndex As Integer
Public Command As String
Private Sub Form_Load()
USB.CommPort = 3
USB.Settings = "9600,n,8,1"
USB.RThreshold = 4
USB.PortOpen = True

Combo1.Locked = True
Combo1.AddItem "MSG0"
Combo1.AddItem "LIT1"
Combo1.AddItem "LIT2"
Combo1.Text = Combo1.List(0)

End Sub
Private Sub Combo1_Click()
CommandIndex = Combo1.ListIndex
Command = Combo1.List(CommandIndex)

End Sub
Private Sub Command1_Click()
USB.Output = Chr(5) & Command

End Sub

I wanted to send the selected item (in string) listed in the combobox through the serial port once the command button is click...
How do i fill in the gaps of my coding??

PLeasee help..

Plz Help With Combobox?
Ok the question is as following, I'm trying to get two values in one combo box, the two value are Achternaam (or in English Surname) and Voornaam (in English First name). I can't get it to work, does anybody have idea? Thnx in advance!

This is part of the code:

Private Sub Form_Load()

Cn.Provider = "Microsoft.Jet.OLEDB.4.0"
Cn.Open "Data Source=" & App.Path & "Jeugd.mdb"

sqlstring = "Select Achternaam, Voornaam " & _
"From Persoonsgegevens "

Set rswpinrzoeken = Cn.Execute(sqlstring)
'Putting the 2 values of the sql string in a var? I was desperate.
Naam = "Achternaam" & "Voornaam"

While Not rswpinrzoeken.EOF
'On this part i get the error.
cmbNaam.AddItem (rswpinrzoeken("Naam"))


End Sub

Copyright 2005-08, All rights reserved