Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296


    Quote Originally Posted by Minty View Post
    Sorry I missed your latest post.

    That might do the trick. Add a debug.print to see if it's working

    Code:
    Private Sub TxtEnterbox_Enter()
    If (iCount >= 6) Then
            Me.DhrScanTxt.SetFocus
            iCount = 0
    End If
    Debug.Print iCount
    iCount = iCount + 1
    End Sub
    Edit - you'll need to use the change event possibly?
    I added Debug.Print (and after googling it) It doesn't work still. On change it doesn't seem to work but if I do on enter it seems to only count 1 instead of looping.
    I suppose I could just have it count to 1 and set focus to the main text box?

  2. #17
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    I got it working with the following code:
    Code:
    Private Sub TxtEnterbox_Enter() 'Function to handle the extra 6 carriage returns on the barcodesIf (iCount = 0) Then iCount = 1 'Used to correct the count at start up
    If (iCount >= 1) Then
            Me.DhrScanTxt.SetFocus
            iCount = 0
    End If
    iCount = iCount + 1
    End Sub
    Now I just need to add a few more features before its done. Hopefully I should be fine.
    I very very much appreciate the help!

  3. #18
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Glad you got is worked out. Certainly a tricky problem to get around.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Text boxes filled with black when focused
    By milton837 in forum Forms
    Replies: 7
    Last Post: 09-08-2019, 02:36 PM
  2. How to highlight all text when tabbing to a field
    By Allen Sundholm in forum Forms
    Replies: 3
    Last Post: 07-27-2019, 07:56 PM
  3. Replies: 15
    Last Post: 02-17-2019, 06:19 PM
  4. Replies: 5
    Last Post: 01-24-2018, 10:45 AM
  5. Highlight text in memo field
    By silverspr in forum Programming
    Replies: 2
    Last Post: 03-27-2011, 04:58 PM

Tags for this Thread

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