RE:NOVATO!! NECESITO AYUDA POR FAVOR
Bueno... Atento a esto :D puede ser complicado el codigo pero esta hecho a medida :P.
Te explico primero:
- El formulario tiene 5 cajas de texto (textbox) creadas como matrices de 1 a 5.
Para crear matrices solo compias el textbox y lo pegas hasta que te ponga el index a 5 y luego borras el textbox k pone 0 de index.
- Tienes dos botones uno para mandar los datos al txt y otro para recoger los datos y ponerlos cada uno en cada caja.
- Y por ultimo tienes un CommondDialog llamado CD.
Y aqui tienes el codigo :D no te asustes :P
'Con esto guardas el archivo de las 5 cajas de texto en un TXT
Private Sub Command1_Click()
Dim Texto
Dim Ban As Boolean
Dim i, J As Integer
CD.Filter = "Archivo de Texto (*.txt)|*.TXT"
CD.ShowSave
If CD.FileName <> "" Then
If Dir(CD.FileName) <> "" Then 'Si Existe el Archivo
Kill CD.FileName 'Lo Eliminamos
End If
Open CD.FileName For Output As #1
Texto = Text1(1).Text & ";" & Text1(2).Text & ";" & Text1(3).Text & ";" & Text1(4).Text & ";" & Text1(5).Text & ";"
Print #1, Texto 'Esto es como un Enter. Un salto de carro
Close #1
End If
End Sub
'Con esto coges el archivo y pones cada dato en cada caja
Private Sub Command2_Click()
Dim a As String
Dim i As Integer
Dim x As Integer
x = 1
CD.Filter = "Archivo de Texto (*.txt)|*.TXT"
CD.ShowOpen
If CD.FileName <> "" Then
Open CD.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, a 'Leer
Loop
Close #1
End If
For i = 1 To Len(a)
If Mid(a, i, 1) <> ";" Then
If x < 6 Then
Me.Text1(x).Text = Me.Text1(x).Text + Mid(a, i, 1)
End If
Else
x = x + 1
End If
Next
End Sub
Ales :D buena suerte (*^_^*)