Results 1 to 5 of 5
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316

    Leave Single Character Field when Entered

    How can I have a field on a form that is a single character so that when the operator enters a valid character, the cursor moves to the next field without having the operator hit the enter or tab key? Thanks, Eddie

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Try the Change event, the Len() function and the .Text property of the textbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Like this:

    Code:
    Private Sub TargetControl_Change()
      If Len(Me.TargetControl.Text) = 1 Then
       NextControlName.SetFocus
      End If
    End Sub

    Linq ;0)>

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No learning how to fish around here!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    This worked fine. The only tweak I needed was that if the entered data was more than one character, I trimmed it down to just the leftmost one... Thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Single character fields through memos
    By whiskers197u8 in forum Import/Export Data
    Replies: 3
    Last Post: 12-07-2012, 07:14 PM
  2. Check for required when leave the field
    By Rhubie in forum Forms
    Replies: 13
    Last Post: 09-12-2012, 02:17 PM
  3. 4th character of a field
    By Rhubie in forum Access
    Replies: 20
    Last Post: 08-28-2012, 04:04 PM
  4. Prefix character in ID field
    By Zbeibu in forum Access
    Replies: 2
    Last Post: 05-14-2012, 07:21 AM
  5. Fixed character length of field
    By tylerg11 in forum Access
    Replies: 3
    Last Post: 09-29-2011, 11:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums