Discussione:
textbox che diventa null
(troppo vecchio per rispondere)
pfm
2017-05-17 10:48:34 UTC
Permalink
salve

ho una textbox (txtpassword)
con la proprietà maschera input password


non capisco come mai se attivo il controllo keyDown
perdo il valore digitato (diventa null)


Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then ' 13
Debug.Print txtPassword.Value
cmdOk_Click
End If
End Sub



Private Sub cmdOk_Click()

Debug.Print "txtPassword " & txtPassword.Value

If txtPassword = "xxx" Then
bOkPassword = True
Else
bOkPassword = False
End If
DoCmd.Close
End Sub
@Alex
2017-05-17 19:26:49 UTC
Permalink
prova a leggere la proprietà TEXT invece della proprietà VALUE.

@Alex
GiorgioDaPrato
2017-05-18 07:42:18 UTC
Permalink
Post by pfm
salve
ho una textbox (txtpassword)
con la proprietà maschera input password
non capisco come mai se attivo il controllo keyDown
perdo il valore digitato (diventa null)
Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then ' 13
Debug.Print txtPassword.Value
cmdOk_Click
End If
End Sub
Private Sub cmdOk_Click()
Debug.Print "txtPassword " & txtPassword.Value
If txtPassword = "xxx" Then
bOkPassword = True
Else
bOkPassword = False
End If
DoCmd.Close
End Sub
sembra però che tu voglia IMPORRE la pressione del tasto Enter per "chiudere"
la stringa password: per valutare la stringa possono bastare gli "eventi update" (after, ma anche Before se devi controllare i caratteri accettabili)
Continua a leggere su narkive:
Loading...