Natannn

Páginas: 2 (469 palabras) Publicado: 2 de marzo de 2010
Private Sub alta_Click()
Dim Lineadetexto As String
Dim Nombre As String
Open "C:\ORLANDO\clientes.txt" For Input As #1
Do Until EOF(1)
Line Input #1, Lineadetexto
Nombre =Trim(Mid(Lineadetexto, 1, 50))
If Text1 = Nombre Then
Text2 = Trim(Mid(Lineadetexto, 52, 1))
Text3 = Trim(Mid(Lineadetexto, 54, 2))
Text4 = Trim(Mid(Lineadetexto, 57, 23))
Noesta = True
MsgBox "REGUISTRO EXISTENTE "
Close #1
Exit Sub
End If
Loop
If EOF(1) Then
Close #1
Noesta = False
End If
If Noesta = False Then
Open "C:\ORLANDO\clientes.txt" For Append As #2
Print #2, Tab(1);Text1; Tab(52); Text2; Tab(54); Text3; Tab(57); Text4
Close #2
MsgBox " REGUISTRADO... "
End If
End Sub

Private Sub baja_Click()
Dim Lineadetexto As String
Open"C:\ORLANDO\clientes.txt" For Input As #1
Open "C:\ORLANDO\Nuevo.txt" For Output As #2
Do Until EOF(1)
Line Input #1, Lineadetexto
If Text1 Trim(Mid(Lineadetexto, 1, 50)) Then
Print #2, Lineadetexto
End IfLoop
Close #1
Close #2
Kill "C:\ORLANDO\clientes.txt"
Name "C:\ORLANDO\Nuevo.txt" As "C:\ORLANDO\clientes.txt"
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
MsgBox " REGISTRO BORRADO "End Sub

Private Sub Buscar_Click()
Dim Lineadetexto As String
Dim Nombre As String
Open "C:\ORLANDO\clientes.txt" For Input As #1
Do Until EOF(1)
Line Input #1, Lineadetexto
Nombre =Trim(Mid(Lineadetexto, 1, 50))
If Text1 = Nombre Then
Text2 = Trim(Mid(Lineadetexto, 52, 1))
Text3 = Trim(Mid(Lineadetexto, 54, 2))
Text4 = Trim(Mid(Lineadetexto, 57, 23))
Noesta = TrueMsgBox " REGUISTRO EXISTENTE "
Close #1
Exit Sub
End If
Loop
If EOF(1) Then
MsgBox " REGUISTRO NO EXISTENTE "
nomensaje = True
Close #1
Noesta = False
End If
End Sub

PrivateSub cambio_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Dim Nombre As String
Dim Lineadetexto As String
Open "C:\ORLANDO\clientes.txt" For Input As #1
Do Until EOF(1)
Line Input #1,...
Leer documento completo

Regístrate para leer el documento completo.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS