' Ch 9 Demo 1
' Mr. Minich
' Purpose - to illustrate the use of a sequential access file
Option Explicit
Private Sub Form_Load()
Dim strPassword As String ' real password, read from file
Dim strUserPassword As String ' user's inputted password
Open "Z:\Basic\Ch 9\Ch9Demo1\ch9demo1data.txt" For Input As #1
Input #1, strPassword ' reading password from file
Close #1
strUserPassword = InputBox("Enter the password:")
If (strUserPassword <> strPassword) Then
Unload Me ' end program if password is incorrect
End If
End Sub