TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 271
- Office Version
- 365
- Platform
- Windows
Hello,
I have a form with a listbox which is populated by some SQL code, typically:
This works perfectly except for the alignment of the numbers in several of the columns. They appear like this
whereas I'd like them to look like
Can I align them or is this a limitation of using a listbox?
Many thanks.
I have a form with a listbox which is populated by some SQL code, typically:
VBA Code:
rs.MoveFirst
i = 0
With Me.ListBox1
.Clear
.ColumnWidths = "210;50;120;110;100;64;75;46;45;45"
Do
.AddItem
.List(i, 0) = rs![Practice]
.List(i, 1) = rs![TotalDocCount]
.List(i, 2) = Format(rs![TotalDocValue], "#,##0.00;(#,##0.00)")
.List(i, 3) = rs![RetroDocCount]
.List(i, 4) = Format(rs![RetroDocValue], "#,##0.00;(#,##0.00)")
.List(i, 5) = rs![NonRetroDocCount]
.List(i, 6) = Format(rs![NonRetroDocValue], "#,##0.00;(#,##0.00)")
.List(i, 7) = rs![Less1k]
.List(i, 8) = rs![Onekto5k]
.List(i, 9) = rs![Fivekto10k] + rs![Tenkplus]
' .List(i, 10) = rs![Tenkplus]
i = i + 1
rs.MoveNext
Loop Until rs.EOF
End With
This works perfectly except for the alignment of the numbers in several of the columns. They appear like this
Code:
0.00
79.34
131.23
whereas I'd like them to look like
Code:
0.00
79.34
131.23
Can I align them or is this a limitation of using a listbox?
Many thanks.