set value from listbox as label caption

madEG

Registered User.
Local time
Today, 18:03
Joined
Jan 26, 2007
Messages
307
Hello,

I just can't think of a nice way to do this...

I have a listbox that contains a column whose data is greater in width than what seems to be access's ability to scroll horizontally. (even after much grief trying to find out why the H-scroll bar wouldn't appear, I can't get the H-scroll bar to show the whole fields's length... but that aside...)

So, I am left with a few options...

One: create a multiline listbox... (fat chance...)

Two: Upon selection of the record in the listbox, get this long text description value and set it to be the caption for a label on the screen.

That seems doable... except that I con't figure out how to approach this.

I guess I can use lstItems.ItemSelected to get the bound column's value and do a separate sql look to the backend (sql server) to return the description and set the label to this string - but that seems like overkill seeing how the descrption text is already in the listbox - why go get it again.

So, in short, can anyone think of an easy way to upon selecting a record in a listbox that I can set a label's caption (on the same form) to be the value of one of the columns that are showing in that listbox?

Thanks in advance... I need more coffee...

-Matt G.
 
you should be able to just put this in a textbox's control source:
=[lstMyListBox].[Column](2)
 
Wazz, you rock. Thanks!
 

Users who are viewing this thread

Back
Top Bottom