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

Listbox to textbox

P: 36
HI all,

I have 2 forms
1. MainForm
2. SubForm

Then I have a listbox in the subform and textbox in the mainform.

(when i click on the listbox item) (i dont want multi selections)
I want to get the selected item from the listbox and put it in to the textbox

can somebody help me on this
Jul 21 '07 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,607
HI all,

I have 2 forms
1. MainForm
2. SubForm

Then I have a listbox in the subform and textbox in the mainform.

(when i click on the listbox item) (i dont want multi selections)
I want to get the selected item from the listbox and put it in to the textbox

can somebody help me on this
In the AfterUpdate() Event of the List Box Control, place silimiar code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub lstListBoxName_AfterUpdate()
  2.   'assuming you are copying the Value in the Bound Column
  3.   Me.Parent![txtTextBoxOnMainForm] = Me![lstListBoxName]
  4. End Sub
Jul 21 '07 #2

Post your reply

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