Below is the code I have for the keypad. It's in the form's keydown event and it just saves each number the user presses until they press the enter key. As for the barcode reader I haven't done much with that yet because this is where my question is about recognizing it as the barcode reader instead of an input from the keypad. I tested the barcode reader in a textbox that had the focus and it does work, and it's just plug and play. I'm wondering if there is a way to recognize that an input is coming in from USB port 1 versus an input coming in from USB port 2. Thanks for your help.
''if user hits enter key on keypad
If e.KeyCode = Keys.Enter Then
''save data to SQL
Dim command As SqlCommand
Dim commandString As String
If gStudentId.Length = 6 Then
commandString = "INSERT into CafeTest values (@Acct);"
command = New SqlCommand(commandString, MyConnection)
command.Parameters.Add(New SqlParameter("@Acct", SqlDbType.Char))
command.Parameters("@Acct"

.Value = gStudentId
command.ExecuteNonQuery()
''clear global student ID for next entry
gStudentId = ""
End If
gStudentId = ""
Else ''pressing a number
If e.KeyCode = Keys.NumPad0 Then
gStudentId = gStudentId & "0"
ElseIf e.KeyCode = Keys.NumPad1 Then
gStudentId = gStudentId & "1"
ElseIf e.KeyCode = Keys.NumPad2 Then
gStudentId = gStudentId & "2"
ElseIf e.KeyCode = Keys.NumPad3 Then
gStudentId = gStudentId & "3"
ElseIf e.KeyCode = Keys.NumPad4 Then
gStudentId = gStudentId & "4"
ElseIf e.KeyCode = Keys.NumPad5 Then
gStudentId = gStudentId & "5"
ElseIf e.KeyCode = Keys.NumPad6 Then
gStudentId = gStudentId & "6"
ElseIf e.KeyCode = Keys.NumPad7 Then
gStudentId = gStudentId & "7"
ElseIf e.KeyCode = Keys.NumPad8 Then
gStudentId = gStudentId & "8"
ElseIf e.KeyCode = Keys.NumPad9 Then
gStudentId = gStudentId & "9"
End If
End If