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




AddItem To Combo List And Have The Combo List Be Able To Retain The Item Upon Recall


I have a project that I need to do for school. You are to have a command button, a combo/dropdown list and a text box, you are to enter a name and birthday in the text box and when you click on the command button it is supposed to enter it in the combo box. My problem is that I got it to enter into the combo box with additem, but it will not retain the item that I just added. When I close the program the item I added does not stay there. How do I get the combobox to retain everything that I add through the textbox on command click. PLEASE HELP




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Combo Box Additem To List
I'm just learning VB, I'm trying do make a database, and a combo box contains a list of customers, I want the user to select from the list, but if they are typing a new name when they add the record the new company name will be added to the list.

I was saying:
Dim Customer as String
customer = cboCustomer.text

If cboCustomer.text <> cboCustomer.dataitem Then
cboCustomer.additem Customer
End If

It will add the item to the list at runtime, but if I stop the program and run it again, the new items entered are not in list anymore.
I was just using the list property of the combo box to populate the list with a few items. But I might use a text file or a table in Access with all the company names.

Can you tell me what I am doing wrong, and if there is a better way to do this.
Thanks.

Finding List Item As U Typed In Combo Box(Dropdown List Style).
Basically the title say it all.

When I type a letter in combo box it finds item by matching the letter that I typed, but when I type in a second letter it searchs item that starts with the second letter.

I wonder is there a way to macthing list item as u typed in combo box(Dropdown List style).

Thanks in advance.
Joon

Combo Box, Item Not On List
Hi,

How can I prevent the message " Item does not exist on the list" from appearing? I am using the not-in-list event to perform a procedure and I only want my message to appear. Using Docmd.CancelEvent has not helped me. Any suggestiong?

Thanks

Adding Item To Combo Box List Property Permently
guyz is there any way i can add data to combo box list property in vb 6. using a text box and command button and add it to the list property permentaly so when the form loads again then that data should be in the combo box

i hope you understood me

for example

in design time in vb6 you create combo box then you selected list property and enter some data in the list

then create command button & textbox

then use textbox & command button to add data from textbox to combo list property permentaly so when form load again that entered data should be in the combo box

please help me if you know how to crack this problem

thank you in advance

Getting A Combo Box List And Putting It In A List Box List On Another Form
I am finally writing my first MDI! I'm doing a lot better than I thought I would so far, but now I'm stuck. I need to have a list from a combo box copied into a list box on another form. I want it in the Form_Load() event. Right now I have:

Code:Private Sub Form_Load()
frmpresetedit.deletepreset.List = frmtimer1.cmbpresets.List
frmpresetedit.Show
End Sub

deletepreset is the list box, cmbpresets is my combo box.
It always comes up with a compile error at the .list part of cmbpresets.list and says that 'the argument is not optional'. What is my problem here? I'm sure this problem is simple and I'm probably just making a stupid mistake. What code do I need to use?
Thanks


Now, don't get me wrong, 'cause baseball's a great sport.
It teaches little children simple eye-hand coordination with little effort or exhaustion.

 -byufan

Edited by - byufan on 7/20/2004 4:20:57 PM

Activex Controls For List Box, List View & Combo Box (for Storing Arabic Language)
Hi all,

Can any one having controls (list box, list view , combo & date
picker ) with right alignment. i.e scroll bar should come in left side
instead of right...simalry drop down for combo box should be in left side
instead of right side.

This i need for storing Arabic data...

Thnaks
Sridhar CS

What Is The Limits On COmbo Box, List Box And LIst View And How Do You Handle Situations W
OK<
I have looked at all 5 of my vb Barnes and noble books
under listbox
and did not find where it said what the limit was.

I learned how to read a data base (unbound even) into a list box, or combo box.

But now I have over 32,768 items,
my data base list has between 100,000 - 125,000 Parts I want to load.

I can think of a lot of cases where the data base you want to load into a list or combo box is well of 32768


So my questions are
( I did also search VBCITY)

1) What is the limits on
listbox
combo box
list view

and

where is it documented.

and 2

How do I handle the case of more than 32768 with a listview??

I did found a little bit about it on vbcity

Thanks



 

Teams List And ID's List On Combo Box And Label1.caption
Hello there, how are you guys doing?
I've got one problem, i dont know how to, basically finish my project which need to have this implented:

I have file called "teams.ini" in which there are like 2500 lines, here are few samples:

Juventus,23
Real Madrid,33
Arsenal,66
Newcastle,55

and so on... what i want is to show Team name in Combo Box(ex. Juventus) and i want it's id (ex. 23) to be show on the label1.caption, and that for all the teams, there are arounf 2500 teams with it's ID afterr comma.

I hope someone can help me with the code (if its not that complicated code)

Thanks alot!

How To List The Items Of Combo List When It Get Focus Without Click On It
Hi:
Here I have problem, I have a Combo list. If the user don't want to use mouse, and She want the Combo list list all of of it's item just like mouse click on it when she use TAB to focus on it. How can I implement this function. If anybody know about it. It will be very helpful
Millions of Thanks.


wky086

Combo Box - List
hi, good day to all.....
i have a problem regarding to combo box, hope i can get some opinion from you all.thanks.

components:
1 combo box with 2 list: commercial, agriculture.
1 text box.
1 command button.

database
name:fyp.
fields: common, sideissue.

problem:
when i first select "commercial" and key in the side issue, then save it into the database. when i check again the database, both data also key in into the 2 fields. however, when i select again the "commercial" and add side issue, this time only the side issue has data and the common field leave blank. what can i do to it?

this is my source code:

Private Sub Command1_Click()
On Error GoTo AddErr
If (Combo1 = "" Or txtFields(1) = "") Then
MsgBox "PLEASE FILL ALL FIELD", vbExclamation, "Data Incomplete"
Combo1 = ""
txtFields(1) = ""
txtFields(1).SetFocus
Exit Sub
End If
datPrimaryRS.Recordset.AddNew
Load process
process.Show
Exit Sub
AddErr:
MsgBox Err.Description
End Sub

Besides that, a message box "unable to bind to field or DataMember: Common". what is this mean about?

thanks again and hope have a nice day.

Combo List
When i haver a combo list how do i change it so the names are static so they cant type in that field?

Combo List Box
How come I can't SetFocus to a Combo List Box on the Load_Form Sub? Is this not allowed?


Code:
Private Sub Form_Load()

List.SetFocus

End Sub

COMBO List
i have a ado and a combobox, what i want is to show a list in the combbox, list should be related to the recordset from the ado. how should i do that?

List Box Or Combo?
I have a mp3 player that has a form that is diplayed up the top of the screen and what I want to happen is when I click Label1 Then a combo box drops down with the song names, but before I click it, it is invisible.

Thanks
Dan_

Combo Box List
Hello,

i've a combo box with a list, user have to select one item, but don't have to write any new item, how may i do this?


thanks,
Bagbones

List Box/ Combo Box
How can I modify the content of my list and combo boxes without having to erase every item and enteringnew one???

List/Combo Box
Is there a way in which i can display a combo box that shows a list of all records in a field of a database (Access). Then the user may sellect a record which they want to use... i.e i hav a field of products in access and i want the user to be select the from a combo or list box which product they want. ne help i am most grateful for... cheer!!!

Combo List Help
I have a combo list that contains emails for logging into specific websites. Here's the code I'm using:


Code:
Private Sub Command2_Click()

WebBrowser1.Document.All("email").Value = Combo1
WebBrowser1.Document.All("password").Value = Text2
WebBrowser1.Document.getElementById("Submit22").Click
End Sub
Is there a way to change the dropdown list in the combo list to more memorable words rather than emails, but still have the emails value for logging in?

Combo Box Or List Box ??
I am using several small windows.
Space is at a premium.
At present, each window is just big enough to hold a combo box.
The drop down list works great for listing Read Only information only when needed.
This works fine but again, as space is at a premium, The initial empty text box for entering data is a waste of space.

Recommendations ???

Thank you in advance...

List 1 Combo-box
I have a form displaying a combo-box which the user selects a type of order that is going to be entered into an access database.

What I would like the program to do is when it is first ran that it automatically drops the listbox to show the entire listing of orders! What command would enable me to perform the same function as if someone clicked on the down-arrow in a list-box?

Someone please help.

Help With Combo/list Box
Hello, I'm new to programming and have made it to this point and now I'm completely frustrated. I'm trying to finish a project that will allow the user to select the type of detail for their car from a combobox. Based on the selection made the interior and exterior work will be displayed in their respective listbox, but it is not happening. I've tried add.item to display the work and I've also tried loading all the work that can take place in the list property then trying the remove.item method. Needless to say that didn't work either. Can someone tell me if I'm close or provide and example or even tell me if I'm off in left field.
Thanks
Pitman
Well this is my logic
Private Sub cboPackage_Change()
If cboPackage.Text = Standard Then
lstExterior.List = "Hand Wash"
End If
End Sub

Combo Or List Box In VBA
Does anyone know the syntax for inserting a Combo or List Box in a VB Procedure that the user would interact with?
I'd appreciate the help.

Combo Box List
Hi!,

I'm new to VB and now I'm trying to create a program that link to my Access database. I created a combo box in my form and when the program run that time, I want the user to select their choice based on the record in the table (which I have created in Access 2000).

Problem is now I don't know how to call the data and place it in the combo box. Did anyone know? Any help will be appreciated.


Thanks alot!

Combo Box -&gt; List Box
hi,
i have a combobox is populated from MS Access. I want to populate my
Listbox with all the names associated with that user group selected from the Combobox.
currently i have this code:


Code:
Private Sub cboState_Click()
With cboState
adoCompanyDetail.Recordset.Filter = "State Like '" & _
.List(.ListIndex) & "*'"

End With
End Sub


Private Sub Form_Load()
With adoState.Recordset


Do Until .EOF

If !State <> "" Then
cboState.AddItem !State
End If
.MoveNext
Loop
.Close
End With
End Sub

Combo List
i want help about combo key press event. When i press "a" in combo box then combo should show all list which is start with alphabet "a" . and when i press "ab" in combo box then combo should show all list which is start with alphabet "ab" . How can i do that?

Plz Help me.........

thanks in advance

List Box Or Combo Box
Hi guys, im lil bit newby to programming so forgive my stupidity please.

i intend to write a program that will be able to store a list of films and a list of games.

(There is going to be one box for films and one box for games)

would i require a list box or a combo box to store the film/game names inputted?

and also is it possible to make the combo/list box scrollable?


All feedback is appreciated thx

Sql List Box Or Combo
I need to populate a list or combo box (preferred) with info from an sql to an oracle database, I know how to connect to the database but I don't know how to populate the list/combo box with the information from it, I have looked through the various forums and I don't seem to be able to find anything, any ideas.............

List Box 2 Combo Box
Ok complete newbie

i have a list box with a load of stuff.... i then have a combo box that i want the contents of the list box to load int0. i dont mind using a comand button if its gunna be any easier.... all i can get to happen is just the highlighted item in the list is transferred.


any help here?

Getting Name From Combo Box List
how do i get a name from combo box list and add it to a label

ie i have the following list in a combo box and want to be able to append it to an label along with other information



Code:
cboohmslaw.AddItem "Mega"
cboohmslaw.AddItem "Kilo"
cboohmslaw.AddItem "milli"
cboohmslaw.AddItem "micro"
cboohmslaw.AddItem "pico"
cboohmslaw.AddItem "nano"

and i want to add one of the values when i click on the combo box and output to a label as follows..

for example when i select the first option i.e. listindex=O then i want to be able to output txt3/100000 & insert appropriate code here & lbl3


Code:
Private Sub cboohmslaw_Click()
Select Case conversion1
Case cboohmslaw.ListIndex = 0
lblohmsans = txt3 / 100000 & & lbl3
Case cboohmslaw.ListIndex = 1
lblohmsans = txt3 / 1000 & lbl3
Case cboohmslaw.ListIndex = 2
lblohmsans = txt3 * 1000 & lbl3
Case cboohmslaw.ListIndex = 3
lblohmsans = txt3 / 1000000 & lbl3
Case cboohmslaw.ListIndex = 4
lblohmsans = txt3 / 1000000000 & lbl3
Case cboohmslaw.ListIndex = 5
lblohmsans = txt3 / 1000000000000# & lbl3
End Select
End Sub

[b]

Combo/List Box
Hi,

Does anyone know how I can use the VB's combo/list box in Access. What I need is to be able to add text items with the AddItem method. The Access' combo/list box doesn't allow you to.

Thanks,

List And Combo Box
I am trying to use a random access file to store information. The application is pretty standard with an 'Add new' a 'next' and 'previous' button to add new record and browse through the file. I want one of the fields in the file to be populated by the user making a selection from a list or combo box. When the file is saved and reloaded I would like the previously selected item displayed in the list or combo field.

Can someone show me how to do this please.

Combo+List Box
What is the difference between combo box and list box?

Combo Box Value List
Is it possible to have a value list for a combo box in VB..

I am moving my databases to SQL and using VB as the front end. I want a combo box to be linked to a certain field and give the user certain choices to choose from..

Can someone help?

Thanks

DVannoy
A+,Network+,CNA
dvannoy@onyxes.com


Combo List --- I Am New
I have been searching the net to find someone that can help me and your website is great and very helpfull. I have a project where I have a existing database which is my client list. I have various functions that I would like this program to preform one of them is to call a existing client from the database by means of DataCombo (I got this code from your site ... thanks ), but more than that I need after calling this dropdown from the database to complete about 15 more text fields. The code I used below works ... I have tried to use various ways to do this. If i can resolve this i will be able to complete most of my programming queries I already have.

Your kind response to this problem will be appreciated.


Option Explicit

Dim strSQL As String

Private Sub DataCombo5_Click(Area As Integer)
  txtCustName.Text = DataCombo5.ListField
  txtCustName.Text = DataCombo5.BoundText
  Adoclients.Recordset.MoveNext
End Sub

Private Sub Form_Load()
  Call DataOpen(goConn)
  Call LoadDataComboBox("Customer", DataCombo5)
  
End Sub


Private Sub LoadDataComboBox(tblName As String, dbcControl As DataCombo)
  Dim oRS As New ADODB.Recordset
  
  strSQL = "SELECT * FROM " & tblName
  oRS.Open strSQL, goConn, adOpenForwardOnly
  Set DataCombo5.RowSource = oRS
  DataCombo5.ListField = oRS.Fields("Account Code").Name
  DataCombo5.BoundColumn = oRS.Fields("Customer Name").Name

End Sub

Getting The List For Combo Box
I have two tables and one form
     The tables are Accounts and AccountTypes. They have One-to-Many Relationship. AccountTYpes have only one field and that is AccountTypes. I am using the ADO provided with DataEnvironment. I add a new command for Accounts Table under my dataconnection. This I simply Drag that fields to my form. Add some Buttons and then add code to the buttons. I addded a combo box on the form and wished that combo box to contain all the records from the AccountTypes table. When I run this form The Combo Box Only Shows One Record. It is not showing any list. How Can I configure the Combobox to Show the All Records instead on Just ONE record.

Getting A List In A Combo Box
Okay im thick and a new to VB.
Im trying to get a database into VB which i have done using a 'data' tool.
Then using lables to show the data using their 'Data Source' and 'Data Field' Captions.
I am using an Excel table to sow the data.

One field i have is 'name' and i would like to be able to use a combo box to show all the different names in the database.

But when i set it up like the labels it only shows the entry i am on, understandable when i think about it.
But what i need is that it shows all the name and then shows you the data in that row.
Please help and i am new to all this.

Thanks
Jon Handby

Combo Box List
I'm trying to populate a combobox list.... i don't want the data linked, just a list of words that are set.

thanks

List In The Combo Box
Hi! Do you know how to put a list on the combo box wherein i'm going to include from year 2000 up to year 3000 co'z if im goin to use additem, it will take forever.

cmbyear.additem 2000
cmbyear.additem 2001
cmbyear.additem 2002

Thank you so much!!!

How To Get The List To A Combo Box
How to get the data of a list box in a combo box??

THX

Combo Box/list Box
HI,
I am trying to use a combo box and in the properties i set the value of "style" to 2-Dropdown List.
The items in the combo box will be "right" and "left"
I want to set "right" as the default value.
ie when i load the form i should see "right" in the combo box.
Thanks for the help,
Vasu

Combo/List
Hi,

Which one of the following is a better way for programming in List/Combo Box Controls

1. Add items at design time using "List" property
2. Add items using additem function during run time.

Considering that the values in list/combo are going to hardcoded e.g. (100,200,300)

Thanks,
AnkuR.

Combo / List Box
Dear All,
I stored some data in Combo / List box. I wish to filter the item as user type something in a combo. The problem is combo does not automatically all available items in the combo window. I have to press Alt+ down Arrow Key to show. In case of Combo please tell me how to automatically show items in combo window.
In case of list box, How do I connect a text box to list box to filter the contents fo list box.

Santulan

Combo To List Box
How do you add items from a combo box to a list box?

List Box Combo
i have two listbox in a programme . based on one selection i ned to populate the other listbox. and if list box1's item is deselceted then all item pertaining to it should be removed . but as on select and deselect only click event is fired . i tried to set a flag too but it doest worked that way.. please help

Combo/list Box Help
Ok Here is what i am doing-- I am trying to design a Random CounterStrike Team Generator

What i have-- a Drop DOwn Combo Box , with 10 names

NExt i have an Enter Button, the user will choose thier name and hit the Enter button and it will randomly pick a team- Terrorists or Counter Terrorists. ONce it picks your team it puts your name into a list box at the bottm- I have to list box's (Terrorists, and COunter-Teorrists)

i want the teams to be 5 vs 5 - how do i manage this. Heres my code so far


Code:

Dim T$, CT%, Random%, x$
Dim Fbomb$, BatTle$, Shzooom$, TheGreenJim$, RoXxEr$, AccesstionJacksson$, notFrosh$, Delete$, SDawg$, Crazed$

Private Sub cmdclear_Click()
lstT.Clear
lstCT.Clear
End Sub

Private Sub cmdend_Click()
End
End Sub

Private Sub cmdteams_Click()
Call Randomize
Random = Int(Rnd * 2)

'sets varibales'
If Random = 0 Then
lstT.AddItem (Combo1.Text)
End If

If Random = 1 Then
lstCT.AddItem (Combo1.Text)
End If
'end'


'DIsables Lst'
If lstT.ListCount = 5 Then
lstT.Enabled = False
End If

If lstCT.ListCount = 5 Then
lstCT.Enabled = False
End If
'end disable'

Fbomb = 0
BatTle = 1
Shzooom = 2
TheGreenJim = 3
RoXxEr = 4
AccesstionJacksson = 5
notFrosh = 6
Delete = 7
SDawg = 8
Crazed = 9

x = Combo1.ListIndex()


Combo1.RemoveItem (x)

End Sub

Combo Box List Options
I am using a combo box on a Userform and I need to get records from a SQL database any samples of how I would do this??? I have never used SQL with VBA before so this is very new to me.

Drop Down List Combo Box
I want the user to select one of many options. So first I used I drop down combo box. I didn't like it because the user could enter something. So I changed it to a drop down list combo box. The user can't add anyhting now. My question is how do I reset the textbox? When I start the program the box is blank but once the user selects something is there any way to reset it? I can't make it equal to "".
Any ideas?
Thanks, AL

Distinct List From Combo Box
What I am doing is pulling from an access database a list of zip codes for one company. So that company may have 3 facilities in different locations.

However here is the catch, there may be 10 entries for that company. See each time a new contact gets addeded this becomes a new entry in the table. It may have a new zip or be the same as another one already in the DB.

What I have done is pulled all the zips for that facility out of the database and put them in a combo box on my form. Now I want to click that and only show each one once.

I thought of creating a new table and posting the company/zip there and then running a distinct query on the zip, but I am not sure how to create the table and it seems more complicated than I need.

Thanks for any ideas!!

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