Private Sub Command1_Click()
Dim iCanal As Integer, sPath As String
Dim bEncontrado As Boolean
sPath = App.Path
If Right(sPath, 1) <> "\" Then sPath = sPath & "\"
iCanal = FreeFile
Open sPath & "datos.dat" For Input As #iCanal
Do Until bEncontrado Or EOF(iCanal)
Input #iCanal, namec
Input #iCanal, direc
Input #iCanal, telc
Input #iCanal, emc
Input #iCanal, comc
If Text6.Text = namec Then
Text1.Text = namec
Text2.Text = direc
Text3.Text = telc
Text4.Text = emc
Text5.Text = comc
MsgBox "La ficha de " & Text6.Text & " ha sido encontrada", vbInformation + vbOKOnly, "Información"
bEncontrado = True
End If
Loop
if Not bEncontrado Then huhu
Close #iCanal
End Sub
Private Sub huhu()
If MsgBox("La ficha de " & Text6.Text _
& " no ha sido encontrada." & vbCrLf _
& "Desea realizar una nueva busqueda ?" _
, vbQuestion + vbYesNo, "Información") = vbYes Then
Text6.Text = ""
Text6.SetFocus
End If
End Sub