Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

vb leer fecha archivo secuencial

Estas en el tema de vb leer fecha archivo secuencial en el foro de Visual Basic clásico en Foros del Web. Hola soy jilo2011 leer fecha archivo secuencial soy novato en programacion vb, y quisiera hacer consulta por fecha, hasta ahora tengo el siguiente codigo Código: ...
  #1 (permalink)  
Antiguo 16/03/2015, 12:12
 
Fecha de Ingreso: mayo-2012
Ubicación: provincia de barcelona
Mensajes: 2
Antigüedad: 12 años
Puntos: 0
vb leer fecha archivo secuencial

Hola soy jilo2011

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

Etiquetas: fecha, vb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:16.