Private Sub UserForm_Activate()
If dbconn.State = adStateClosed Then dbconn.Open strConn
Dim rs As New ADODB.Recordset
ListBox1.Clear
ListBox1.ColumnCount = 6
rs.Open "select idClient,client_name,Address,City,state,country from tblClients", dbconn
Do While rs.EOF = False
i = i + 1
With UserForm2.ListBox1
.AddItem rs(1) i getting an error here mixmatch
.List(.ListCount - 1, 1) = rs(2)
.List(.ListCount - 1, 2) = rs(3)
.List(.ListCount - 1, 3) = rs(4)
.List(.ListCount - 1, 4) = rs(5)
.List(.ListCount - 1, 5) = rs(0)
End With
rs.MoveNext
Loop
rs.Close
With cmbCountry
.AddItem "United States"
.AddItem "Canada"
.AddItem "Germany"
.AddItem "Australia"
End With
cmbCountry.ListIndex = 0
End Sub
If dbconn.State = adStateClosed Then dbconn.Open strConn
Dim rs As New ADODB.Recordset
ListBox1.Clear
ListBox1.ColumnCount = 6
rs.Open "select idClient,client_name,Address,City,state,country from tblClients", dbconn
Do While rs.EOF = False
i = i + 1
With UserForm2.ListBox1
.AddItem rs(1) i getting an error here mixmatch
.List(.ListCount - 1, 1) = rs(2)
.List(.ListCount - 1, 2) = rs(3)
.List(.ListCount - 1, 3) = rs(4)
.List(.ListCount - 1, 4) = rs(5)
.List(.ListCount - 1, 5) = rs(0)
End With
rs.MoveNext
Loop
rs.Close
With cmbCountry
.AddItem "United States"
.AddItem "Canada"
.AddItem "Germany"
.AddItem "Australia"
End With
cmbCountry.ListIndex = 0
End Sub