+ Reply to Thread
Results 1 to 16 of 16

Setting focus back to textbox after cell populate for next entry

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Setting focus back to textbox after cell populate for next entry

    Hi All

    I find that selecting a cell and then scanning barcodes, enters the value into cell, then moves down to next cell automatically.
    How can I achieve this though userForm textbox scanning. i.e

    Scan into textbox and then automatically have scanned item appear in cell then clear textbox and scan next one etc etc etc
    Last edited by sintek; 09-08-2017 at 03:49 PM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Vba for scanning barcode into textbox and then populate cells

    K. so got that part working for first initial scan....Trying to get the textbox to set focus after the update but not able to.

    Here is code...Any ideas
    Please Login or Register  to view this content.
    Edit2...

    I noticed that after scanning the next tab index is triggered which is a command button so I inserted the setfocus code within, however, no I have to scan twice to trigger the setfocus code...

    How am I able to set the focus back after update??


    Edit3...
    Figured it out....
    Please Login or Register  to view this content.
    NOOOOOOO

    Now I can't do anything else until I cancel the code....
    Last edited by sintek; 09-08-2017 at 09:29 AM.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Vba for scanning barcode into textbox and then populate cells

    Any one perhaps have a solution for me...have searched the web to no avail...
    Last edited by sintek; 09-08-2017 at 03:50 PM.

  4. #4
    Registered User
    Join Date
    02-22-2016
    Location
    Harare, Zimbabwe
    MS-Off Ver
    2007 & 2010
    Posts
    71

    Re: Setting focus back to textbox after cell populate for next entry

    Try TextBox27.Select
    Happy? Click the * to the left.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    Hi myou....No go.
    Have added
    Please Login or Register  to view this content.
    to my code and created a fictional hidden command button with tab index set to follow and code within that sets focus...This works however, it changes every second scan to proper text and not upper as should be...

  6. #6
    Registered User
    Join Date
    02-22-2016
    Location
    Harare, Zimbabwe
    MS-Off Ver
    2007 & 2010
    Posts
    71

    Re: Setting focus back to textbox after cell populate for next entry

    O.K.

    What about;

    Please Login or Register  to view this content.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    Tried that as per Post2....Does not allow code to exit...
    This solution has worked...And then hidden commandbutton with setfocus code....
    Please Login or Register  to view this content.
    Not gonna mark as solved just yet as there are multiple instances on web without results...

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    Hi All

    Wondering if anyone has a better solution for me....

  9. #9
    Forum Contributor
    Join Date
    08-09-2012
    Location
    British Columbia
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Setting focus back to textbox after cell populate for next entry

    Any ideas from this from another project using textbox_Change
    Please Login or Register  to view this content.
    Last edited by NoSparks; 09-14-2017 at 09:58 AM.

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    Thanks NoSparks for response, but not...

  11. #11
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Setting focus back to textbox after cell populate for next entry

    What controls do you have on the form?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    meaning....Controls from toolBox

  13. #13
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Setting focus back to textbox after cell populate for next entry

    Yes- which ones are on the form? Just the textbox and button, or any others?

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    Have uploaded sample...Thanks for taking time to hAve a look.
    Attached Files Attached Files

  15. #15
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Setting focus back to textbox after cell populate for next entry

    I don't have a scanner but perhaps this
    Please Login or Register  to view this content.
    that would allow you to exit the textbox as long as it's empty?

  16. #16
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,338

    Re: Setting focus back to textbox after cell populate for next entry

    You are a genius xlnitwit....that is perfection...thanks so much...Can't spread any more +++++

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. barcode scanning
    By mojobaabby in forum Excel General
    Replies: 12
    Last Post: 02-01-2017, 04:19 PM
  2. Barcode scanning help
    By abirup in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2016, 04:36 AM
  3. Barcode scanning
    By abirup in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2016, 08:39 AM
  4. VBA Advice: Scanning a one barcode to talk to multiple other cells from another sheet
    By nkcwilliam1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2016, 03:58 PM
  5. parsing when scanning a barcode in a textbox
    By cutaway2 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 07-10-2015, 01:43 PM
  6. VBA barcode scanning
    By JoboM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2015, 02:30 AM
  7. [SOLVED] Check barcode scanning
    By intex in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-25-2015, 02:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1