473,396 Members | 2,109 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,396 software developers and data experts.

Moving selected items from combo box to text box

I have read through the threads and have been unable to find an answer to my simple question and this newbie is stuck.

Here is what I am trying to do.

I have a combo box that contains a list of items that are pulled from a table. I want to populate another box (text, combo) doesn't matter what with the selected information from the first box. Everytime I select something in the first box, it overwrites what is in the second box. I have also tried using a button to move all of the selected items over, but that isn't working either. This is something new I am trying to do.....any help would be really appreciated!
Aug 3 '07 #1
4 5388
missinglinq
3,532 Expert 2GB
To move an item from a combobox to a textbox

Expand|Select|Wrap|Line Numbers
  1. Private Sub MyComboBox_AfterUpdate()
  2.   Me.MyTextBox = MyComboBox
  3. End Sub
  4.  
To move an item from a combobox to a textbox, then move another item over, and so on (With a ; and a space between each item)

Expand|Select|Wrap|Line Numbers
  1. Private Sub MyComboBox_AfterUpdate()
  2. If IsNull(Me.MyTextBox) Then
  3.  Me.MyTextBox = MyComboBox
  4. Else
  5.  Me.MyTextBox = Me.MyTextBox & "; " & MyComboBox
  6. End If
  7. End Sub
Welcome to TheScripts!

Linq ;0)>
Aug 3 '07 #2
Thank you sooo much! That worked perfect.

To move an item from a combobox to a textbox

Expand|Select|Wrap|Line Numbers
  1. Private Sub MyComboBox_AfterUpdate()
  2.   Me.MyTextBox = MyComboBox
  3. End Sub
  4.  
To move an item from a combobox to a textbox, then move another item over, and so on (With a ; and a space between each item)

Expand|Select|Wrap|Line Numbers
  1. Private Sub MyComboBox_AfterUpdate()
  2. If IsNull(Me.MyTextBox) Then
  3.  Me.MyTextBox = MyComboBox
  4. Else
  5.  Me.MyTextBox = Me.MyTextBox & "; " & MyComboBox
  6. End If
  7. End Sub
Welcome to TheScripts!

Linq ;0)>
Aug 3 '07 #3
missinglinq
3,532 Expert 2GB
Glad we could be of help!

Linq ;0)>
Aug 3 '07 #4
Glad we could be of help!

Linq ;0)>
Is it possible to move the items that are clicked to a table instead?

Thanks!
Aug 14 '07 #5

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

Similar topics

2
by: faisalsns | last post by:
Hi, I am facing a peculiar problem in setting the selected index 9 of a customised combo programitically. For rest of the index it gets set but for the index 9 i.e element no 10 in the datatable it...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
2
by: Stephen Miller | last post by:
When I dynamically populate a HtmlSelect combo box, the Value property consistently fails to return the item selected, defaulting instead to the first item in the list. For example: Protected...
0
by: Ioannis Demetriades | last post by:
Hi, I need to implement the a drop down list of items with some of the items displayed as disabled. Disabled items are shown but cannot be selected by the user. My first thought was to use a...
6
by: Matt | last post by:
I'm not entirely sure how to describe this issue. I have a number of ComboBoxes in my application which have their text properties bound to a field in a data set. The items loaded in the ComboBox...
1
by: OwlHoot | last post by:
I am using Thomas Fuchs's amazing drag-and-drop JavaScript library available at: http://wiki.script.aculo.us/scriptaculous/show/DragAndDrop to allow the user to select a subset of items listed...
2
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a...
4
by: rn5a | last post by:
I am binding a DropDownList with records existing in a database table. I want to add an extra item *SELECT COMPANY* at index 0 so that by default, it gets selected. This is how I tried it but the...
6
by: Smokey Grindle | last post by:
Say I have a combo box with the following simple object Public class MyObject public ID as integer public Name as string public overrides sub ToString() as string return name end sub end...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.