Combo box + Barcode Scanner

Ben171

Board Regular
Joined
Jul 2, 2021
Messages
88
Hi all, i have a userform in excel which i want to use a barcode scanner to enter data so that there are no errors.

For textboxes, the barcode scanner works fine. However in a combo box that I have, the barcode scanner enters the correct text but then instantly wipes it out

Is there anything i can do to stop this?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
More than likely, yes.
Can you post the code associated with the combo box?
 
Upvote 0
More than likely, yes.
Can you post the code associated with the combo box?

Hi sure,

My code for this combo box is very simple

VBA Code:
Sub cmboProduct_AfterUpdate()
    ' Find the record that matches the control.
    Me.RecordsetClone.FindFirst "[product] = '" & Me![cmboProduct] & "'"
    Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
 
Upvote 0
Don't see anything there that would clear the combo.
Presumably the same code in a textbox_AfterUpdate event is working as expected but isn't for this combobox.

Try putting a breakpoint on the first line of this code and run the code with the F8 key one line at a time from there when the vba window opens watching for what line of code is the cause of the combo clearing. Execute the End Sub with F8 also and the next code to run will still be in one line at time mode.

The Windows key + right arrow will put the vba window on the right half of your screen so you can see the sheet/userform on the other half.

Sorry, that didn't answer your question but hope it's of some use.
 
Upvote 0
Don't see anything there that would clear the combo.
Presumably the same code in a textbox_AfterUpdate event is working as expected but isn't for this combobox.

Try putting a breakpoint on the first line of this code and run the code with the F8 key one line at a time from there when the vba window opens watching for what line of code is the cause of the combo clearing. Execute the End Sub with F8 also and the next code to run will still be in one line at time mode.

The Windows key + right arrow will put the vba window on the right half of your screen so you can see the sheet/userform on the other half.

Sorry, that didn't answer your question but hope it's of some use.

Thanks for your help that is a very good idea. I have solved the issue (sort of)

I have instead configured the barcode scanner to not press enter after scanning. Doing so makes this work fine with the combo box, only problem is user has to manually press enter but that is not the end of the world.

Thanks
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,852
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top