I have pulled information from an access table into a listview item within Visual Basic 2010. It displays all the information, field by field how I want it...however one of the fields has a lot of text. It stops after the specified lenght with ... suggesting there is more text that doesn't fit. I have used "-2" to make it longer, but then it's too long. Also scrolling wouldn't be very nice.
I'd like it to display the information from the field on two lines, but I can't figure it out. Here's my existing text (without the dims as I've made it flat at the moment)
objConnection = CreateObject("ADODB.Connection")
objRecordset = CreateObject("ADODB.Recordset")
dbasename = "D:\technicianmanagement.MDB"
tblname = "FaultCalls"
objConnection.Open("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & dbasename)
objRecordset.Open("SELECT * FROM " & tblname & " ORDER BY DATEREP DESC, TIMEREP DESC", objConnection, adOpenStatic, _
adLockOptimistic)
lvref.Clear()
lvref.View = View.Details
lvref.Columns.Add("Ref", 40, HorizontalAlignment.Left)
lvref.Columns.Add("User", 75, HorizontalAlignment.Left)
lvref.Columns.Add("Asset", 100, HorizontalAlignment.Left)
lvref.Columns.Add("Fault", -2, HorizontalAlignment.Left)
lvref.Columns.Add("Assigned", 75, HorizontalAlignment.Left)
lvref.Columns.Add("Date", 50, HorizontalAlignment.Left)
lvref.Columns.Add("Time", 75, HorizontalAlignment.Left)
lvref.Columns.Add("Email", 40, HorizontalAlignment.Left)
Do While Not objRecordset.EOF
MyListText(0) = sID
MyListText(1) = sUser
MyListText(2) = sAsset
MyListText(3) = sFault
MyListText(4) = sAssigned
MyListText(5) = sDate
MyListText(6) = sTime
If sEmail = True Then MyListText(7) = "Yes" Else MyListText(7) = "No"
MyListItem = New ListViewItem(MyListText)
lvref.Items.Add(MyListItem)
objRecordset.MoveNext()
Loop










