On DataChange Event Procedure Question

Joined
Nov 28, 2004
Messages
14
This might be a tricky one.

We are using a barcode scanner to scan a 5 digit unique code into a table thru a form. The scanner is populating the field correctly, but what we have tried to do is allow the vb to hit the enter key after the data reaches the 5th digit so the user can scan a list of approx 400-500 barcodes easily without having to press enter after each scan to move to the next record. The bar code will always be 5 characters.

The problem is this, the spell check tries to correct the entry because the code can be a series of letters. For example: vXBxL . Unless I am completely blind, I don't see anyway to stop the spell check from running.

Is there some other way to fix this problem?

Here's the code so far. this is on our form under the On DataChange event procedure .


Private Sub Form_DataChange(ByVal Reason As Long)

If Len(UniqueCode) = 5 Then
SendKeys ("{enter}")
End If
End Sub

Any help would be greatly appreciated!

Adam
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,787
Messages
6,121,558
Members
449,038
Latest member
Guest1337

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