By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,289 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,289 IT Pros & Developers. It's quick & easy.

Moving selected items from combo box to text box

P: 16
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
Share this Question
Share on Google+
4 Replies


missinglinq
Expert 2.5K+
P: 3,532
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

P: 16
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
Expert 2.5K+
P: 3,532
Glad we could be of help!

Linq ;0)>
Aug 3 '07 #4

P: 16
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

Post your reply

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