Showing a description in a TEXT box

  • Thread starter Thread starter Colin Ward
  • Start date Start date
C

Colin Ward

Hi.

I have a list box and a text box on a form.What I want to
have happen is when the user clicks something in the list
box, I want to see the description of the selected item
in the text box. the trouble is I cant figure out how to
link the two because a text box doesn't have a rowsource
property. I would use a list box but someof the
descriptions are quite long.

Thank you

Colin
(please email me at the address above as well as posting
here)
 
The following code run in the AfterUpdate event of the
list box. My list box is called lst_Data and my text box
is called txt_Selected

Private Sub lst_Data_AfterUpdate()
txt_Selected.Value = lst_Data.Value
End Sub

In the design view, select your list box and then in the
properties window select the Events tab. Click in the
AfterUpdate event and then click the Elipsis (...) to the
right. This will create the:

Private Sub lst_Data_AfterUpdate()

End Sub

then insert the line of code, adjusting the control names
accordingly.

Hope this helps
 
-----Original Message-----
The following code run in the AfterUpdate event of the
list box. My list box is called lst_Data and my text box
is called txt_Selected

Private Sub lst_Data_AfterUpdate()
txt_Selected.Value = lst_Data.Value
End Sub

In the design view, select your list box and then in the
properties window select the Events tab. Click in the
AfterUpdate event and then click the Elipsis (...) to the
right. This will create the:

Private Sub lst_Data_AfterUpdate()

End Sub

then insert the line of code, adjusting the control names
accordingly.

Hope this helps
Thanks Bish

That worked up to a point. Unfortunately the value
property only returned the row number of the product I
was looking for. I am using a memo field to store the
descriptions. Can a memo field be referenced directly or
do I have to retrieve a recordset first?
 
Back
Top