Can I make a ListBox "word-wrap"?

M

Messa Boogie

Can I make my ListBox so that if data is put into a column it wraps the text
around to the next line? Otherwise I can't see the entire data! Help
 
R

Rick Brandt

Messa Boogie said:
Can I make my ListBox so that if data is put into a column it wraps the text
around to the next line? Otherwise I can't see the entire data! Help

No.

You could build a continuous subform that mimics a ListBox, but it would be
non-trivial to do. Especially if you have the ListBox bound.

You can use a TextBox that displays the text in the ListBox after making a
selection and that TextBox could be more than one line tall. You will only get
255 characters from a ListBox column though.
 
M

Messa Boogie

Is there some other control I could use? Possibly some sort of Grid type
control? Or some sort of Table type control?
 
M

Messa Boogie

Yes, that's a nice idea, but I need for the user to be able to quickly
scroll down a listbox (or some other sort of table-like control) that will
display all of the data.

Any other ideas?
 
R

Rick Brandt

Messa Boogie said:
Yes, that's a nice idea, but I need for the user to be able to quickly
scroll down a listbox (or some other sort of table-like control) that will
display all of the data.

Any other ideas?

I did suggest using a subform. That could be either continuous view or
datasheet (grid) view. How difficult that would be to "make a selection"
similar to a ListBox would depend on what you need to do with the selection once
it is made.

What do you need to do with the selection?
 
M

Messa Boogie

Rick,

It is not 100% manditory that the user be able to "select"
an item in the ListBox. It is, however, 100% manditory that
the data wrap around so that all of the contents are viewed.

That being the case, it seems like a subform might be a good
idea. It looks like creating a subform in Continuous mode
is probably going to work for me. But the only problem I have
with that is that when I display a textbox with a "paragraph"
of info in it, the textbox doesn't wrap the text around to the
next line unless I make the size of the textbox several rows
high - which I don't want to do because several of my records
are only require a single row.

It's hard to believe there isn't a simple "grid" type control that will
let me to what I'm trying to do. Do you still recommend
the continuous forms for me?
 
R

Rick Brandt

Messa said:
Rick,

It is not 100% manditory that the user be able to "select"
an item in the ListBox. It is, however, 100% manditory that
the data wrap around so that all of the contents are viewed.

That being the case, it seems like a subform might be a good
idea. It looks like creating a subform in Continuous mode
is probably going to work for me. But the only problem I have
with that is that when I display a textbox with a "paragraph"
of info in it, the textbox doesn't wrap the text around to the
next line unless I make the size of the textbox several rows
high - which I don't want to do because several of my records
are only require a single row.

It's hard to believe there isn't a simple "grid" type control that
will let me to what I'm trying to do. Do you still recommend
the continuous forms for me?

You only need to make the TextBox (2) rows high for wrapping to occur. Just how
wide are you making the box? If this text is so long that you cannot see all of
it even using two rows then I suggest that the data is not suitable for any sort
of "selection" tool.

There might be a third party ActiveX control that supports a vertical "CanGrow"
similar to Access reports or a web table, but I am not familiar with any as I
avoid non-native controls whenever possible.
 
P

Peter Hibbs

I suggest you use a Flex Grid control. This does what you want and also
allows lots of other facilities such as setting different colours for cells,
left, centre and right alignment of text, different font sizes, etc, etc.

The Flex Grid control which is called MSFLXGRD.OCX needs to be saved to the
folder C:\WINDOWS\System32. You will also need to register it with Windows by
entering the following text in the Run window -

regsvr32.exe msflxgrd.ocx

and then press ENTER, a dialog should then say it has been registered
successfully.

To use the control place it on your form from the Insert -> ActiveX Control
menu, it's called 'Microsoft FlexGrid Control, version 6.0' (or later). You
will need to be familiar with VBA and SQL programming because this control
cannot be bound to a query or table, it has to be populated using VBA code.
Search the Web for MSFLXGRD.OCX for a free download of the file and other
help info. I have also put together a demo form using this control which I
would be happy to e-mail to you if you are interested. Please let me know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top