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.Sorry I missed your latest post.
That might do the trick. Add a debug.print to see if it's working
Edit - you'll need to use the change event possibly?Code:Private Sub TxtEnterbox_Enter() If (iCount >= 6) Then Me.DhrScanTxt.SetFocus iCount = 0 End If Debug.Print iCount iCount = iCount + 1 End Sub
I suppose I could just have it count to 1 and set focus to the main text box?
I got it working with the following code:
Now I just need to add a few more features before its done. Hopefully I should be fine.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
I very very much appreciate the help!
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 ↓↓