Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB - Seperate Barcode Scanner and Keyboard Input

Status
Not open for further replies.

manmmadhok

Programmer
May 30, 2003
4
0
0
GB
Hi there..!
I need some help.
I want to Scan some data in TextBox Field through Barcode Scanner on a particular action and needs to Disable keyboard Input for that action.
For some other action I want accept the keyboard input and disable the Barcode Scanning..

I know its tricky. but just in case if anybody happen to know the solution for this than please HELP...!

Cheers...!

Manish



Manish Madhok
 
Don't know if this will help or not, but I have seen retail barcode programs where the barcode scanner needs to be programmed to send a '?' before the barcode. That is easy to set up for the scanner. In this way you could test the input to see if it is starting with a '?' and then clear it immediately if not...essentially not accepting it.
Good Luck!
 
hey manmmadhok
i just got my hands on a scanner and was wondering how you write the code to a txt box.

cheers NUQE

We all know about the "stupid user" don't we... :)
 
got it hehe damn that's cool

We all know about the "stupid user" don't we... :)
 
hey manmmadhok
i did some fooling around and there's a specific ascii value that is returned when a code is scanned. the one i'm working wiht is 13 so what you could do is

if keyascii

We all know about the "stupid user" don't we... :)
 
DAMMIT!!!

wrong button i clicked dicard the previous post... anyways
i did some fooling around and there's a specific ascii value that is returned when a code is scanned. the one i'm working wiht is 13
i found it out by

Private Sub Text1_KeyPress(KeyAscii As Integer)
Text1.Text = KeyAscii
End Sub


then when you have the ascii value of the scanner you could
have a check box indicating whether you want to use keyboard or the scanner.

ex.

if keyascii = 13 and chkScan.value = vbchecked then
(do what you want with the barcode)

else
discard the barcode
(do what you want with the keyboard entered data)
end if

i dunno if this helps at all hehe
good luck
CHeers NUQE



We all know about the "stupid user" don't we... :)
 
Ascii 13 is a bad way to detect barcode data. 13 is also the enter key so a user entering data and finalizing data entry with enter would also trigger the barcode action. I suggest you program a prefix and a suffix. We at work always use chr(2) (STX) and chr(3) (ETX) for this.
 
If you have a check box to indicate whether you wan to use barcode data then ascii code 13 wouldn't really matter, but good point, i never thought of that.

NUQE

We all know about the "stupid user" don't we... :)
 
You would not want a checkbox as a checkbox requires someone to set it. I personally would want an integration of the scanner without bothering for it. Just using the scanner when I want to is better then enabling a checkbox and scanning.
 
yup, i agree hehe i've never programmed for a scanner, and just tried one today... so i don't know anything haha. just a question if want to bother. How do you program a prefix and suffix for data that has been issued by the scanner??

NUQE

We all know about the "stupid user" don't we... :)
 
Programming a prefix and suffix for a scanner is specific for each scanner. We have had a lot of scanner and each had different ways to program. You have to consult your scanner manual for that. You may also need to disable the default suffix (chr 13).
 
alrighty , i just grabbed a simple barcode wand... i'm not sure if it really has those options, meh, i learned soemthing today.

Hey, where do you think they guy we're supposed to be helping went hahaha

Cheers

NUQE

We all know about the "stupid user" don't we... :)
 
Any decent scanner does have those options. What brand do you have?
 
Intermec sabre 1550


We all know about the "stupid user" don't we... :)
 
According to what I can see in the manual a prefix and suffix should be no problem.
 
hmm, would it say how to set it??

We all know about the "stupid user" don't we... :)
 
Yup, just look better :) Look for a part called Aux Prefix and Suffix selections. Anyway, going to sleep. See ya.
 
thanks... later

NUQE

We all know about the "stupid user" don't we... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top