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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,222,095
Messages
6,163,901
Members
451,865
Latest member
dunworthc

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