Updating Text Box when List Box selection changes

Cavern

Registered User.
Local time
Today, 22:55
Joined
Jul 12, 2002
Messages
31
I have a text box ('DescriptionText') which is supposed to display the 'description' text from an item that is selected in a list ('List6') which displays the name of a habitat, and has the ID and Description fields hidden.

I am trying to use the following code to update the Description text when I change the selection in the List6 box, but it is not working correctly:
Code:
If(Me.List6.ItemsSelected.Count <> 0) Then
  Me.DescriptionText.Value = Me.List6.Column(2, Me.List6.ItemsSelected.Item(0))
Else
  Me.DescriptionTexdt = "No Selection"
End if

This code works fine when I have it set to a button that runs it.. However, when I put the code in the 'click' event, it prints the 'No Selection' message each time... I'm not sure why its doing this. Does anyone have any ideas? Am I putting it in the wrong event, or is there something dismally wrong with the code?
 
Try

=[cboList6].[Column](2)

in the Control Source (In Properties) of your text box "Description Text"

It should update immediately.
 

Users who are viewing this thread

Back
Top Bottom