Visual Basic - A ver esto..

Life is soft - evento anual de software empresarial
 
Vista:

A ver esto..

Publicado por Zlroses (7 intervenciones) el 16/06/2006 11:03:34
Buenas Colegas.. Necesito una mano en esto..

Yo tengo una base de datos en Excel 8.0 y lo que hago aqui es recorrerla y por ej ver si
lo que tengo en el el text relacionado a la base es igual a lo que presento en el combo1
y a su vez otro text relacionado con el combo2 y asi comparando relaciones y en caso de ser iguales me agrega lo que aqui presento en el listbox1 y otras cosas en el listbox2

por ej seria asi

AUTO-H701-04-01
AUTO-H701-04-02
AUTO-H701-04-03
AUTO-H701-04-04
AUTO-H701-04-06
AUTO-H701-04-07
AUTO-H701-04-08
AUTO-H701-04-05
AUTO-H701-04-09

OSEA LOS DATOS A COINCIDIR EN PRIMER LUGAR SERIA QUE ME AGREGUE TODOS LOS QUE CONTENGAN EN AUTO QUE A SU VEZ CONTENGAN H701 Y QUE A SU VEZ CONTENGA 04 Y QUE ME LOS AGREGUE TODOS LOS QUE CUMPLAN CON ESA CONDICION. EL PROBLEMA ES QUE EN LA BASE POR EJ 05 ES EL ULTIMO QUE AGREGUE Y ME LOS AGREGA RECORRIENDO TODA AL BASE DE DATOS PERO COMO POR EJ EL N°9 ESTA EN LA POSICION 3400 Y EL N°5 ESTA EN LA POSICION 3701 OBVIAMENTE COMO CUANDO RECORRE LA BASE DE DATOS Y COMPARA SI ES AUTO, SI ES H701 Y SI ES 04 ENTONCES LO AGREGA POR TANTO NO PUEDO LOGRAR QUE ME ORDENE ESOS ULTIMO NUMEROS COMO VAN.

AHORA PREGUNTO COMO PUEDO HACER YO ESTO, PUEDEN DARME UNA MANO.?

gRACIAS Y SALUDOS...

..
.

Y ASI
ListBox1.Clear
ListBox2.Clear

A = 0
B = 0
inicio1:
data1.Recordset.MoveFirst
comenzar1:
If data1.Recordset.EOF = True Then GoTo FIN1:
If Combo1.Text = (Text1.Text & " " & " - " & Text5.Text) Then
If Combo2.Text = (Text2.Text & " " & " - " & Text6.Text) Then
If Combo3.Text = (Text3.Text & " " & " - " & Text7.Text) Then GoTo agrega:
End If
End If

GoTo avanzar1:

agrega:

Z = ListBox1.ListCount - 1
x = ListBox2.ListCount - 1
For W = 0 To Z
If ListBox1.List(W) = (Text4.Text & " " & "-" & Text19.Text) Then GoTo avanzar1:
Next W

ListBox1.AddItem (Text4.Text & " " & "-" & Text19.Text), A
ListBox2.AddItem (Text1.Text & "-" & Text2.Text & "-" & Text3.Text & "-" & Text4.Text), B
A = A + 1
B = B + 1
GoTo avanzar1:


GoTo avanzar1:

avanzar1:
data1.Recordset.MoveNext
GoTo comenzar1:

FIN1:
End Su
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder