Listbox to textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gayano
    New Member
    • Jul 2007
    • 36

    #1

    Listbox to textbox

    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
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by gayano
    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:
    [CODE=vb]Private Sub lstListBoxName_ AfterUpdate()
    'assuming you are copying the Value in the Bound Column
    Me.Parent![txtTextBoxOnMai nForm] = Me![lstListBoxName]
    End Sub[/CODE]

    Comment

    Working...