Hola, que tal.
Estoy intentando recorrer una colección a través de un bucle dentro de una función y me tira object variable or with block variable not set cuando comienza a recorrer el for:
Les dejo el código:
Saludos!!
Estoy intentando recorrer una colección a través de un bucle dentro de una función y me tira object variable or with block variable not set cuando comienza a recorrer el for:
Les dejo el código:
Código (vb) [Seleccionar]
Public Function CargaGrillaComers(pr As Collection)
Dim rs As New ADODB.Recordset
Set rs = New ADODB.Recordset
Dim sSql As String
sSql = ""
sSql = sSql & "Select * from Comers "
sSql = sSql & "and Prestamo" & ArmaCadena(pr)
If Conectar() Then
rs.CursorLocation = adUseClient
rs.Open sSql, CN
Set Comers.grGrilla.DataSource = rs
End If
End Function
Código (vb) [Seleccionar]
Public Function ArmaCadena(COL As Collection)
i = 1
sSql = "" & "in ("
For i = i To COL.Count --------------------> Aquí me tira el error
sSql = sSql & COL.Item(i) & ","
Next
sSql = Left(sSql, Len(sSql) - 1)
sSql = sSql & ")"
End Function
Saludos!!