473,326 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to display all items from combobox to textbox when selected one item in combobox

Hi,
I have a combobox with some comments in it .when we select any one item in combobox all the items should be displayed in textbox. please help me with code.

Thanks
Jan 18 '08 #1
1 5672
kadghar
1,295 Expert 1GB
Hi,
I have a combobox with some comments in it .when we select any one item in combobox all the items should be displayed in textbox. please help me with code.

Thanks
Im not understanding quite well, but, what you want to do is to display all the items of the combobox in the text box when you select any one item of the combobox??
lets say your combobox has Item1, Item2, Item3 and Item4

so when you select Item2 in the combobox, the textbox shows Item1, Item2, Item3, Item4 ?? separated by.. lets say commas

just write this in the validate (or change) event of the combobox:

Expand|Select|Wrap|Line Numbers
  1. dim i as long
  2. textbox1.text = ""
  3. for i = 0 to combobox1.listcount -1
  4.     textbox1.text = textbox1.text & combobox1.list(i) & ", "
  5. next
  6. textbox1.text = mid(textbox1.text,1,len(textbox1.text)-2)
this particular case has a lot of sintax that change from one to other version of VB, next time try to tell us what version you're using.
well HTH
Jan 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Piet | last post by:
Hello wxPythoneers. I have a problem with a dialog box derived from wxFrame which has a wxComboBox as main element. Depending on the entry selected from the ComboBox, the dialog box will be...
4
by: Georges Heinesch | last post by:
Hi. I have a combobox with a value list of 4 items. My code needs to know the number of items in that combobox. How can I use VBA to get the number of items in a combobox? TIA --
4
by: Keith | last post by:
Hello - this started out as a minor annoyance - and now is starting to bother me more and more - I'm hoping someone can help me. I would like to have a combobox display - NOT initially be blank...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
3
by: samoore33 | last post by:
I am populating a ComboBox at run time. I insert the first value of "Choose Value" cboTaxValue.Item.Insert(0, "Choose Value") Then I loop through the rest of the values to be added to the...
1
by: Bob Johnson | last post by:
..NET 3.5, Windows Forms app: My objective is to display parent/child data in two ComboBox controls, such that when a parent item is selected in one combo box, associated child items appear in the...
7
by: creative1 | last post by:
hi, I have a simple query. I have a dynamic combobox when I select one value fromt he combobox; on click a function is called that display the value of the combobox(i.e not same as text list of...
2
by: kurtzky | last post by:
i created a form that should function as follows: i will enter a number in a textbox..then it should query from the database all the records which has that number..these records will have a...
1
by: sbandalli | last post by:
Hello, I have a Datagridview which has a combobox,and 2 textbox, The combobox is bound to a Datasource(Database Sql Server and the table name is Category) ,and Datagridview is not bounded to any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.