Run-time error '-2147352571(80020005) Type mismatch please help me to resolve

ubaig

New Member
Joined
Mar 18, 2014
Messages
17
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
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top