InsaneProgrammer
Programmer
I use the code below to make sure the user has entered a UserName and Password before enabling the OK button. I have used this exact code in other applications and it works fine. In the current application I'm developing this code never executes. The Form_KeyUp event never gets called. Anyone have an idea what might cause this? Is it possible that I need to add a reference or something?
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If txtUserName.Text = "" Or txtPassword.Text = "" Then
cmdOK.Enabled = False
Else
cmdOK.Enabled = True
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If txtUserName.Text = "" Or txtPassword.Text = "" Then
cmdOK.Enabled = False
Else
cmdOK.Enabled = True
End If
End Sub