seleccion multiple fileListBox
J = 0
k = 0
Searchchar = " *"
For i = 0 To List1.ListCount - 1
a = InStr(1, List1.List(i), Searchchar, vbTextCompare)
m_len = Len(List1.List(i))
m_descripcion = Left(List1.List(i), a - 1)
m_item = Right(List1.List(i), m_len - (a + 9))
m_antdescripcion = m_descripcion
Do While m_descripcion = m_antdescripcion
If List1.Selected(i) Then
If t = 0 Then
adescripcion(k, 0) = m_descripcion
conectar
Set rsttemp = Nothing
tsql = "Select cert from tabdescripcion where (documento = 'OC' and descripcion= " & "'" & m_descripcion & "'" & " and pedido = " & fpedido & ")"
rsttemp.CursorLocation = adUseClient
rsttemp.Open tsql, strcnn, adOpenKeyset, adLockOptimistic, adCmdText
desconectar
adescripcion(k, 1) = rsttemp!cert
t = 1
End If
conectar
Set rstcarga = Nothing
strcarga = "Select * from tabitem where (documento = 'OC' and descripcion= " & "'" & m_descripcion & "'" & " and item = " & "'" & m_item & "'" & ")"
rstcarga.CursorLocation = adUseClient
rstcarga.Open strcarga, strcnn, adOpenKeyset, adLockOptimistic, adCmdText
desconectar
aitem(J, 0) = rstcarga!Item
aitem(J, 1) = rstcarga!med1
aitem(J, 2) = rstcarga!med2
aitem(J, 3) = rstcarga!med3
aitem(J, 4) = rstcarga!origin
aitem(J, 5) = rstcarga!yitem
aitem(J, 6) = rstcarga!quantity
aitem(J, 7) = rstcarga!qu
aitem(J, 8) = rstcarga!Weight
aitem(J, 9) = rstcarga!price
aitem(J, 10) = rstcarga!pu
aitem(J, 11) = rstcarga!totalitem
aitem(J, 12) = rstcarga!descripcion
J = J + 1
i = i + 1
If i = List1.ListCount Then
Exit Do
End If
a = InStr(1, List1.List(i), Searchchar, vbTextCompare)
m_len = Len(List1.List(i))
m_antdescripcion = m_descripcion
m_descripcion = Left(List1.List(i), a - 1)
m_item = Right(List1.List(i), m_len - (a + 9))
Else
i = i + 1
If i = List1.ListCount Then
Exit Do
End If
a = InStr(1, List1.List(i), Searchchar, vbTextCompare)
m_len = Len(List1.List(i))
m_antdescripcion = m_descripcion
m_descripcion = Left(List1.List(i), a - 1)
m_item = Right(List1.List(i), m_len - (a + 9))
If i = List1.ListCount Then
Exit Do
End If
End If
Loop
i = i - 1
t = 0
If i = List1.ListCount Then
Exit For
End If
Next i