leer fecha archivo secuencial
soy novato en programacion vb, y quisiera hacer consulta por fecha, hasta ahora tengo el siguiente codigo
Código:
Este formulario es el de grabar datos lo hace perfecto. Dim fecha As String Dim nombre As String Dim apellido As String Dim producto As String Dim cantidad As Integer Dim precio As Integer Dim total As Integer Dim archivo As String Private Sub Command1_Click() Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Text2.SetFocus End Sub Private Sub Command2_Click() Dim i As Integer fecha = Text1.Text nombre = Text2.Text apellido = Text3.Text producto = Text4.Text cantidad = Text5.Text precio = Text6.Text total = Val(Text5.Text) * Val(Text6.Text) Text7.Text = Val(Text5.Text) * Val(Text6.Text) archivo = App.Path & "\ventas.txt" Open archivo For Append As #1 Write #1, fecha, nombre, apellido, producto, cantidad, precio, total For i = 0 To List1.ListCount - 1 Print #1, List1.List(i) Next i Close #1 End Sub Este formulario es el de consula Dim fe As String Dim nom As String Dim apel As String Dim prod As String Dim cant As Integer Dim prec As Integer Dim tot As Integer Dim archivo As String Private Sub Command1_Click() Unload Me Form1.Show End Sub Private Sub Command2_Click() Text1.Text = "" List1.Clear Text1.SetFocus End Sub Private Sub Command3_Click() List1.Clear List2.Clear Dim k As Integer If Text1.Text = "" Then Exit Sub fe = Format(Text1.Text, Date) Text1.Text = fe Form2.Text2.Text = nom Form2.Text3.Text = apel Form2.Text4.Text = prod Form2.Text5.Text = cant Form2.Text6.Text = prec Form2.Text7.Text = tot archivo = App.Path & "\ventas.txt" Open archivo For Input As #1 If fe = Date Then While Not EOF(1) Input #1, fe, nom, apel, prod, cant, prec, tot List1.AddItem fe & " " & nom & " " & apel & " " & prod & " " & cant & " " & prec & " " & tot Wend End If Close #1 End Sub
El problema esta que a la hora de leer la fecha me lee todo de golpe y yo quisiera leer por fecha.
si alguien me puede ayudar
Gracias