Thanks, but I am not 100% sure how to do this. I took out the code so it looks like this: Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click If txtIntrest.Text = ("") Then MsgBox("Please Enter Intrest Rate", MsgBoxStyle.Exclamation) Exit Sub End If If Not txtIntrest.Text.Equals(myline) Then Dim pass As String = InputBox("Enter the Password", "Enter Password", "", ) If pass = "Password" Then Dim intrest As String = InputBox("Enter The New Intrest", "Enter Intrest Rate", "", ) txtIntrest.Text = (intrest) Dim theFile As FileStream = File.Create("ir.txt") Dim writer As StreamWriter = New StreamWriter(theFile) writer.WriteLine(txtIntrest.Text) writer.Close() theFile.Close() Exit Sub End If End If End Sub So the password box just closes when the wrong password is input. I want the password box to keep displaying istead of closing and if you type password wrong three times, this code to execute: MsgBox("You have had three attempts to input password, Program will now close for security reasons", MsgBoxStyle.Critical) Application.Exit() but I was told I could do this with a loop, but was not sure how I had code: Static passnum As Integer Do passnum = +1 Loop Until passnum = 3 but was not sure where to put it so it worked, any ideas?
In the end we're all just the same