Results 1 to 8 of 8

Thread: [RESOLVED] How can I simulate Enter key as barcode scanner

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2009
    Posts
    131

    Resolved [RESOLVED] How can I simulate Enter key as barcode scanner

    Hi All
    i get data from input (serial port) and show it in text box .now i need when all data show in text box ,enter key happen ,just like barcode scanner when read data and send enter key as auto.
    what should i do?
    thanks all

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: How can I simulate Enter key as barcode scanner

    Depends on how you are coded, you could call the keypress event of the textbox and pass it a 13 for the KeyAscii parameter, you could use SendKeys to send an Enter keypress. You could configure whatever is sending the data through the commport to send the enter key code, you could add code to the routine where you receive the data to do an enter key.

    How you are processing the data and why you need the enter key press is important. When posting for help you should always give a fully detailed message so we do not need to guess.

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: How can I simulate Enter key as barcode scanner

    Every barcode scanner I have ever used had config options for things like "leading" and "trailing" keypress characters to be added to the scan.

    Otherwise they would be useless as "add-on" tools for existing UI screens.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: How can I simulate Enter key as barcode scanner

    Yes, every one I have saw had this ability as well though I am not sure the OP is talking about a scanner sounds like he wants something to work like a scanner with auto enter key press.

    More info would be helpful.

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: How can I simulate Enter key as barcode scanner

    Wow - I just re-read the OP and I believe it's not a barcode scanner question at all...

    @unforgiven747 - please show the code you are using to load the textbox from the serial port.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How can I simulate Enter key as barcode scanner

    enter key happen ,just like barcode scanner
    you should be able to block (remove) chr(13) in change event of textbox
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: How can I simulate Enter key as barcode scanner

    I think the OP wants to "emulate the enter" key when the serial port load of the textbox is complete.

    That's why I asked to show code...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2009
    Posts
    131

    Re: How can I simulate Enter key as barcode scanner

    Hi All
    I use keypress event of textbox and pass it to sub to run command.
    thanks all

Posting Permissions

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



Click Here to Expand Forum to Full Width