i tried a sample code from this forum which shows the below error
Code: Select all
unknown identifier: SerialPort (Form1.class:3) error
Code: Select all
Bus 003 Device 020: ID 24ea:0197 Meva Barcode Scanner
Code: Select all
unknown identifier: SerialPort (Form1.class:3) error
Code: Select all
Bus 003 Device 020: ID 24ea:0197 Meva Barcode Scanner
Form_Open()
tbxBarCode.SetFocus
End
tbxBarCode_KeyPress()
If Chr$(13) Then
lblScannedBarCode.Text = tbxBarCode.Text
Endif
End
The Label is just to be able to have some code in the KeyPress event to demonstrate that the barcode is scanned.gbWilly wrote: ↑Wednesday 30th March 2022 4:56pm Hi,
I run into this same problem a while ago.
First of all, forget SerialPort, it is way more simple (as Cogier already stated).
The USB barcode scanner acts as keyboard input.
Make a form with a TextBox (let's call it tbxBarCode) and a Label (let's call it lblScannedBarCode)
Next apply following code on the FormThe Label is just to be able to have some code in the KeyPress event to demonstrate that the barcode is scanned.
Form_Open() tbxBarCode.SetFocus End tbxBarCode_KeyPress() If Chr$(13) Then lblScannedBarCode.Text = tbxBarCode.Text Endif End
I have an application that scans this code in a TextBox that is invisible (but keep in mind the TextBox does needs the focus upon scanning) and next, after scanning, starts to give some info on the scanned article (like name, price etc.) retrieved from a database.
I guess you can take it from here, feel free to ask if you get into trouble.
Enjoy...