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

    Highlighting Field Data when Entered


    I have a datasheet form with one numeric field per row where the operators will accept or update. This is high-volume so I'm trying to make this as fast for the operators as possible. When the operator gets to a row, I would like the field to appear as if the data has had the mouse dragged across it, so that when the operator types a digit, it will replace the previous value. If the operator just hits enter, the value won't be changed. How can I do that? Thanks, Eddie

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You can have the data selected when the control gets focus, example:

    Private Sub tbxDateOut_GotFocus()
    Me.tbxDateOut.SelStart = 0
    Me.tbxDateOut.SelLength = Len(Nz(Me.tbxDateOut, ""))
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  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
    Quote Originally Posted by EddieN1 View Post

    ...When the operator gets to a row, I would like the field to appear as if the data has had the mouse dragged across it...
    It sounds as if you want the Control to have the focus as soon as the user moves to a Record; if this is correct, just modify June7's code slightly and place it in the Form_Current event:

    Code:
    Private Sub Form_Current()
      tbxDateOut.SetFocus
      Me.tbxDateOut.SelStart = 0
      Me.tbxDateOut.SelLength = Len(Nz(Me.tbxDateOut, ""))
    End Sub

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313
    This works as long as the form is in Continuous Form view, but not in Datasheet view. Any way I can make this work in Datasheet view? Thanks for your help. Eddie

  5. #5
    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
    Don't really know what to tell you; works as it should, for me, in a Form in Datasheet View!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Format field base on entered data
    By survivo01 in forum Forms
    Replies: 3
    Last Post: 10-26-2012, 02:48 PM
  2. Replies: 2
    Last Post: 07-30-2012, 03:26 PM
  3. Lock a field after data has been entered
    By winterh in forum Forms
    Replies: 8
    Last Post: 03-15-2012, 03:32 AM
  4. Highlighting Items in List Box from Table Data
    By swalsh84 in forum Programming
    Replies: 2
    Last Post: 01-25-2010, 08:55 AM
  5. Highlighting Report Data Based on a Condition
    By KramerJ in forum Reports
    Replies: 1
    Last Post: 05-29-2009, 10:27 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