Multi line list box (1 Viewer)

DanielR

Registered User.
Local time
Today, 06:21
Joined
Mar 16, 2018
Messages
72
Is it possible to have a multi line list box in access?
 

DanielR

Registered User.
Local time
Today, 06:21
Joined
Mar 16, 2018
Messages
72
I meant where a line of text wraps around and becomes a multi line item
 

jdraw

Super Moderator
Staff member
Local time
Today, 09:21
Joined
Jan 23, 2006
Messages
15,378
Perhaps you could give us an example of what you are trying to accomplish.
Why a listbox? How about a textbox?

Have you tried Google to see if there are similar requests?
 

DanielR

Registered User.
Local time
Today, 06:21
Joined
Mar 16, 2018
Messages
72
I am trying to display 3 fields in a table format in a list box.
One of the fields contains notes and I would like to have the text wrap around to multi lines. Furthermore, I would like to have a line drawn between each record set with a vertical scroll bar.
Hope this makes sense.
 

jdraw

Super Moderator
Staff member
Local time
Today, 09:21
Joined
Jan 23, 2006
Messages
15,378
What happens when you try it? Error number?

I think by default a list box entry will be 1 line. But, there's a lot of creativity out there, so someone may have customization that would apply.

If I had a longer text string say 78 characters and wanted to display it in several "lines", say line length 23 chars, an approach might be:
-dim a tmpstring
-take the text string.
-starting in position 23 look for space
--if found, then put the 23 chars to my tmpstring and add a vbcrlf
then start checking chars 24--to 46,
--if not found,then start working from 23 back(eg 22,21...) until you find a space (natural break so to speak)
-continue that process until the initial string has been processed.

move the tmpString to the output.

I don't know if this will work with a list box or not (it's just how you might approach converting a long string into multiple short strings on different "lines".

Good luck.
 
Last edited:

DanielR

Registered User.
Local time
Today, 06:21
Joined
Mar 16, 2018
Messages
72
That solution of breaking up the text into multiple line might work.
How do I separate one record set from the next?
How do I draw a line in between?
 

Beetle

Duly Registered Boozer
Local time
Today, 07:21
Joined
Apr 30, 2011
Messages
1,808
You might look into what Stephen Lebans has here, a collection of customized list box functionality.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:21
Joined
May 7, 2009
Messages
19,230
Or use continuous subform
 

DanielR

Registered User.
Local time
Today, 06:21
Joined
Mar 16, 2018
Messages
72
I will try to explain more clearly what I am looking to do:
I am looking at displaying a log showing 3 columns: task, username and dat.
When I display these 3 columns in a list box, I can only display 1 line per entry.
The task field sometimes requires several lines of text.
How can I display a multi line entry in a list box?
Does this clarify my intent?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:21
Joined
May 7, 2009
Messages
19,230
You cant with the listbox, as suggested use subform.
 

isladogs

MVP / VIP
Local time
Today, 14:21
Joined
Jan 14, 2017
Messages
18,213
Your intent is clear.
Even if it's possible to do, I think your listbox will look a mess if you do this.

I suggest a different approach which I use with both listboxes and continuous subforms which include lengthy text or memo fields. Use a double click event to open a popup form showing the full notes field in a textbox.
 

Users who are viewing this thread

Top Bottom