M
Mark
I am struggling to make a listbox display more than two columns. The
list box is set to value and I use the following VBA to populate it:
Dim myrs As ADODB.Recordset
Dim SQL As String
SQL = "SELECT tblTempContractNoteIDs.* FROM tblTempContractNoteIDs;"
Set myrs = New ADODB.Recordset
myrs.Open SQL, CurrentProject.Connection, adOpenKeyset
Me.lstChoices.ColumnCount = 7
Do While Not myrs.EOF
Me.lstChoices.addItem (myrs.Fields(1)
& ";" & myrs.Fields(2) & ";" & myrs.Fields(3) & _
";" & myrs.Fields(4) & ";" &
myrs.Fields(5) & ";" & myrs.Fields(6) & ";" & myrs.Fields(7))
myrs.MoveNext
Loop
When manually running the SQL statement all 8 columns are returned?
Any suggestions would be greatly appreciated.
list box is set to value and I use the following VBA to populate it:
Dim myrs As ADODB.Recordset
Dim SQL As String
SQL = "SELECT tblTempContractNoteIDs.* FROM tblTempContractNoteIDs;"
Set myrs = New ADODB.Recordset
myrs.Open SQL, CurrentProject.Connection, adOpenKeyset
Me.lstChoices.ColumnCount = 7
Do While Not myrs.EOF
Me.lstChoices.addItem (myrs.Fields(1)
& ";" & myrs.Fields(2) & ";" & myrs.Fields(3) & _
";" & myrs.Fields(4) & ";" &
myrs.Fields(5) & ";" & myrs.Fields(6) & ";" & myrs.Fields(7))
myrs.MoveNext
Loop
When manually running the SQL statement all 8 columns are returned?
Any suggestions would be greatly appreciated.