buuuuuu, me funcionaba perfectamente NO COMPILADO... lo COMPILE y se cagó anda como antes :S :S :S
me quiero matar!!!!!!
a ver si alguien sabe pq ocurre eso :S
------------------------------------------------------------------
Acá les dejo todo...
FORM1
Option Explicit
Private Sub cmdguardar_Click()
Dim renglon As String
Dim archivo As String
Dim info As String
info = txtdatos.Text
archivo = "C:\datos.txt"
'Abre el archivo y almacena lo que tiene txtdatos
Open archivo For Append As #1
Print #1, " " + ">>>" + " " + ""; Format(Time, "hh:mm") + "||" + " " + Format(Now, "dd-mm-yy") + "||" + " " + info
Close #1
txtdatos.Text = ""
Form1.Visible = False
End Sub
Private Sub Form_Load()
Dim archivo As String
On Error GoTo Fallo
archivo = GetAttr("C:\datos.txt")
Fallo:
Open "C:\datos.txt" For Append As #1
Close #1
End Sub
Private Sub Form_Resize()
txtdatos.Width = Me.ScaleWidth
End Sub
Private Sub Timer1_Timer()
If GetKeyState(vbKeyF12) < 0 Then
Form2.Visible = True
End If
End Sub
FORM2
Private Sub cmdvolver_Click()
Form2.Visible = False
Form1.Visible = True
End Sub
Private Sub Form_Activate()
Dim renglon As String
Dim archivo As String
archivo = "C:\datos.txt"
'Carga lo que haya almacenado cuando se cargue el form.
Open archivo For Input As #1
Do While Not EOF(1)
Line Input #1, renglon
txtdatos.Text = txtdatos.Text + renglon + vbCrLf
Loop
Close #1
End Sub
Y acá imágenes de lo que me pasa por si no entendieron
Este es el form 1, ingreso texto, toco escape y se oculta!
Cuando toco F12 se carga el FORM2 con lo que ingresé en el FORM1, hasta ahi todo perfecto!
Pero al tocar el BOTON VOLVER que vuelve al FORM1 para ingresar otro dato y luego de tocar escape y luego F12 para que cargue nuevamente ME PONE 2 VECES LO MISMO EN EL ANOTADOR PORQUE VUELVE A ABRIR EL ARCHIVO.. y ese es mi problema que no vuelva a repetir lo que ya esta :S...
Espero que ahora si me hayan entendido mejor.. desde ya muchas gracias...
PD: También tengo un módulo que solo contiene la API GetKeyState...
Salu2!