Re: textbox and tabkey

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Add a Form to a project with a Textbox and enter the code below in the
KeyPress event.

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyTab Then
Me.BackColor = vbBlue
End If
End Sub



"PC" <Onzin@xxxxxxxxxx> wrote in message
news:uBWVM%23jaGHA.4424@xxxxxxxxxxxxxxxxxxxxxxx
is there any way to detect that the tab-key is pressed in a textbox




.



Relevant Pages

  • Re: Validation Rule and Validation Text Property?
    ... The second example allows only A-Z, 0-9, and a-z. ... Private Sub txtPK_KeyPress ... Select Case KeyAscii ... but the KeyPress event has the advantage of just ignoring bad ...
    (microsoft.public.access.forms)
  • Re: Trapping the Enter Key
    ... Private Sub lstDesc_KeyDown ... You can trap the enter key in the listbox's KeyPress event. ... Say your listbox is called List1 and you have a DoubleClick event for it, and you want the same code to execute when enter is pressed, then make the keypress event look like this: ... If KeyAscii = vbKeyReturn Then ...
    (microsoft.public.access.formscoding)
  • Re: Supress beep on characters
    ... but it still beeps on an C key. ... The MSDN library confirmed that .NET Compact Framework - Windows CE .NET Platform Note: The KeyPress event for combinations using the Ctrl-Shift keys is not provided. ... ignoreKey = False ... Private Sub treeLibrary_KeyPressHandles treeLibrary.KeyPress ...
    (microsoft.public.pocketpc.developer)
  • Re: Trapping the Enter Key
    ... Private Sub lstDesc_KeyDown ... If KeyCode = vbReturn Then ... You can trap the enter key in the listbox's KeyPress event. ... If KeyAscii = vbKeyReturn Then ...
    (microsoft.public.access.formscoding)
  • Re: help on text box
    ... > 'put it in KeyPress event for TextBox: DigitsOnly KeyAscii ... > Private Sub txtTest_KeyPress ... Your code will the user to be able to Paste in non-numeric digits. ...
    (microsoft.public.vb.general.discussion)