Originally posted by yoda
The rule only pertains to Assignments.
Mary
Option Explicit Public LoginSucceeded As Boolean Private Sub cmdCancel_Click() 'set the global var to false 'to denote a failed login LoginSucceeded = False Me.Hide End Sub Private Sub cmdOK_Click() Dim FH As Long FH = FreeFile() Open "H:\_Common\Work2\Stuff for Mr.goss\a.txt" For Append As #FH 'check for correct password If txtPassword = txtPassword Then 'place code to here to pass the 'success to the calling sub 'setting a global var is the easiest LoginSucceeded = True Me.Hide Else MsgBox "Invalid Password, try again!", , "Login Failed" txtPassword.SetFocus SendKeys "{Home}+{End}" End If End Sub
Comment