Hey guys, I'm meddling in VBA, having lots of fun but I'm running into issues.
I'm attempting to use a barcode scanner to scan multiple items into a table. I've gotten everything to input where it should, but when I hit enter (scan button) it goes to the command button automatically. I have dozens of barcodes to scan, so it would be a hassle to have to walk over to my computer and press enter each time. I'm wondering if I can set it to either click "Submit" immediately once I scan something or if I can just have it set focus to my textbox at all times. Please let me know if there's more context needed. Code below
I'm attempting to use a barcode scanner to scan multiple items into a table. I've gotten everything to input where it should, but when I hit enter (scan button) it goes to the command button automatically. I have dozens of barcodes to scan, so it would be a hassle to have to walk over to my computer and press enter each time. I'm wondering if I can set it to either click "Submit" immediately once I scan something or if I can just have it set focus to my textbox at all times. Please let me know if there's more context needed. Code below
VBA Code:
Private Sub cmbSubmit_Click()
Dim LastRow As Long
LastRow = Cells(Rows.Count, 14).End(xlUp).Row
Cells(LastRow + 1, 14).Value = Me.tbxSN1
Me.tbxSN1.Value = ""
Cells(LastRow + 1, 13).Value = Me.cbxTechID
Cells(LastRow + 1, 16).Value = Me.tbxDate
End Sub
Private Sub cmbClose_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.cbxTechID.RowSource = "'Information'!A2:A10"
End Sub