Which Event?

agehoops

Registered User.
Local time
Today, 13:37
Joined
Feb 11, 2006
Messages
351
Which Event do I need to use to check what the user is typing into a box as they are typing it? Have tried using a timer that is activated at a certain point, however it still only checks it once the user clicks out of the control.

Thanks
 
So you want to check the value of the control after each keystroke? Use the On_Key up event.

If you want to check which indivdual key was pressed use the keypress event.
 
hmm still not really working properly. Yea I want it to simply check the text in the text box after every stroke. I'm using the following code in the Key_Up event now.

Code:
If InStr([txtSendTo], "@") <> 0 And InStr([txtSendTo], ".") <> 0 Then
 txtMessageSubject.Visible = True
 txtMessageText.Visible = True
 lblInstructions.Caption = "Please Enter a Subject and Message For The Email, Then Click Send."
 cmdSend.Visible = True
 chkStatus.Visible = True
 txtStatus.Visible = True
 Else
 lblInstructions.Caption = "You Must Include an '@' Symbol and a Full Stop (.) To Proceed."
 txtMessageSubject.Visible = False
 txtMessageText.Visible = False
 cmdSend.Visible = False
 chkStatus.Visible = False
 txtStatus.Visible = False
End If
 
You are not referencing the control correctly. It should be
me.txtSendTo.text

The Text property will show you the uncommited value of the control, the Value property will show you the commited value of the control
 
ah ok that makes sense. Works perfectly now. Thanks :D
 

Users who are viewing this thread

Back
Top Bottom