Rowheight in listbox

nanalachieuse

New member
Local time
Today, 16:30
Joined
Sep 5, 2012
Messages
4
Hi,

I have a listbox in a form with 4 columns (code: 1cm width, type: 3cm width, price:2cm width and description: 5cm width)
But "description" contains a lot of information which need two (or sometimes three) "lines" to read everything.
Do you know how can I change the height of the rows in a listbox so that I can see the whole text?

Or if it is not possible, do you know how to insert a scrollbar in this specific column ("description")?

Thanks !

Nana
 
I don't believe there is any way of controlling the row height in a list box. Your best bet would be to replace it with subform, You could then use data sheet view in which you can change the row height.
 
I saw this answer in many other forums but the problem I've got is that my list box is linked with a macro which allows me when I write something in a text box and click on a checkbox, the list box (linked to one table) find the right result.

I don't know how to write again this macro with a subform (Istresults was the name of the listbox)
This is the part of my macro where I don't know what to modify:

Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case Left(ctl.Name, 3)
Case "Chk"
ctl.Value = 0
Case "lbl"
ctl.Caption = "-*-*-"
Case "txt"
ctl.Value = ""
Case "cb"
End Select
Next ctl
Me.IstResults.RowSource = "SELECT code, type, price, description FROM IRD;"
Me.IstResults.Requery
End Sub

Private Sub refreshquery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT Code, Type, Price, Description FROM IRD Where IRD!ID<>0"
If Me.Chkcode Then
SQL = SQL & "And IRD!Code like'*" & Me.cbsearchbycode & "*'"
End If
If Me.Chkcourse Then
SQL = SQL & "And IRD!Type like'*" & Me.txtsearchbycourse & "*'"
End If
If Me.Chkitem Then
SQL = SQL & "And IRD!Description like'*" & Me.txtsearchbyitem & "*'"
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.Label17.Caption = DCount("*", "IRD", SQLWhere) & " / " & DCount("*", "IRD")
Me.IstResults.RowSource = SQL
Me.IstResults.Requery
End Sub
thanks again !
 

Users who are viewing this thread

Back
Top Bottom