Full Version: View characters that do not fit in a ListBox
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
jpgalasso
I have a ListBox that may not be wide enough to display all of the characters for some of the items in the ListBox. Is there a ListBox property that permits the User to click on an item to view all the characters for the item when the ListBox is not wide enough to show all the characters?
Thank you for any help.
Jim
pere_de_chipstick
Hi Jim
I have used:
MsgBox Me![ListBoxName].Column(1)
To display the visible column (the second column in this case) of a listbox in a message box.
This could go in either the List Boxes Double click event or on a separate command button.
HTH
jpgalasso
Thank you but I was trying to let the User view the name on the Form (i.e. the ListBox) itself. Is that possible?
Thanks again for your help.
Jim
pere_de_chipstick
Hi Jim
don't think you can directly view the complete contents of the visible column of a list box if the text is wider than the width of the list box itself, short of amending the list box and column widths, temporarily, in code; but this could look pretty messy and I wouldn't recommend it.
CAn alternative might be to add an unbound text box on the form
1. Name = ListBoxData
2. Enabled = No
3. Locked = Yes
4. Back Style = Transparent
and in the List box After_Update (or On_Click) event put
Me.ListBoxData = Me![ListBoxName].Column(1)
HTH
jpgalasso
Thank you very much, Bernie.
went with your first suggestion and included a MsgBox when the User clicks an item in the ListBox that lets him either continue with the rest of the macro for the selected item or exit the sub.
Thanks much again.
Jim
pere_de_chipstick
You're welcome thumbup.gif
Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.