borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (can i control telephone by PC?)Next Topic (not found the answer of derive the throughput expression for aloha and slotted aloha . can any one h) New Topic New Poll Post Reply
AndreaVB Forum : Internet Applications : Can i use barcode reader without keyboard?
Poster Message
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 161

icon Can i use barcode reader without keyboard?

I have a program. In my program have one text for input barcode. And i have keyboard and barcode reader.When i used barcode reader it will input in my textbox. But i don want someone press any key in my textbox. It's mean you can used barcode reader but you can not using keyboard to input. Can you help me out?
                                          Thank you for your reading.

____________________________
Please help out.

05-05-2005 at 06:55 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Can i use barcode reader without keyboard?

Hi

If uor using a wedge reader then I don't think its possible to work out where the input came from. However, you can do it by measuring the time it takes for the input to be entered. For example if the input takes longer than 1 second then reject it.
I've knocked up some code which should do it.

Option Explicit

Private StartTimer As Double
Private StopTimer As Double


Private Sub Text1_GotFocus()

    StartTimer = 0
    Text1.Text = ""

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)


    If StartTimer = 0 Then
        StartTimer = Now
    End If
    
    StopTimer = Now
    
    Debug.Print StartTimer & " " & CDate(StartTimer) & " " & StopTimer & " " & CDate(StopTimer)

End Sub

Private Sub Text1_LostFocus()

    If DateDiff("s", CDate(StartTimer), CDate(StopTimer)) > 1 Then
    
        MsgBox "Too Slow"
        Text1.SetFocus
        
    Else
    
        MsgBox "Ok"
        Text1.SetFocus
    
    End If

End Sub




Steve  

[Edited by steve_w on 05-05-2005 at 08:00 AM GMT]

05-05-2005 at 07:55 AM
View Profile Send Email to User Show All Posts | Quote Reply
opice
Level: Trainee

Registered: 29-05-2005
Posts: 1
icon Re: Can i use barcode reader without keyboard?

Hi,

There might be a other option, most scanners have the option to tell what type of barcode it is (code39 or code128 for example). If you turn it on in the scanner then the codes you will scan will always start with the code identifier, you could then put that in the source to ignore all other data if it not starts with the appropriate start characters. If the barcode would read 1234 then the scanner would send for example J11234, where the J1 stands for a certain type of code identifier.

I hope it might be of some use.

take care,
Anthony

29-05-2005 at 08:59 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Internet Applications : Can i use barcode reader without keyboard?
Previous Topic (can i control telephone by PC?)Next Topic (not found the answer of derive the throughput expression for aloha and slotted aloha . can any one h) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder