VBA to control the keyboard wedge type Symbol LT1880 E100E

EDUCATED MONKEY

Board Regular
Joined
Jul 17, 2011
Messages
218
My set up office 2007 win xp pro IE8 keyboard wedge type Scanner Symbol LT1880 E100E <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
Hi i am currently using a barcode scanner to input data, the following problems have arisen<o:p></o:p>
Some books have less than 13 digits and therefore i need to include a warning loop this is proving to be rather more difficult than i first though so i was hoping that one of forum members could point me in the right direction at least or maybe a solution to the problem<o:p></o:p>
Here is the code so far<o:p></o:p>
Rich (BB code):
<o:p></o:p>
Rich (BB code):
Private Sub TextBoxIsbn_Change()<o:p></o:p>
Dim MyData As Variant<o:p></o:p>
Dim BookCount As Integer<o:p></o:p>
Dim testdata As Variant<o:p></o:p>
BookCount = TexetBoxCount.Value<o:p></o:p>
If Len(TextBoxIsbn.Value) = 13 Then<o:p></o:p>
TextBoxLastData.Value = ""<o:p></o:p>
MyData = TextBoxIsbn.Value<o:p></o:p>
TextBoxLastData.Value = MyData<o:p></o:p>
BookCount = BookCount + 1<o:p></o:p>
TexetBoxCount.Value = BookCount<o:p></o:p>
Module11.SaveData (MyData)<o:p></o:p>
ElseIf Len(TextBoxIsbn.Value) < 13 Then   ‘ this is what i thought would work <o:p></o:p>
MsgBox ("problem")<o:p></o:p>
End If<o:p></o:p>
End Sub<o:p></o:p>
<o:p></o:p>
However with that in the fault condition is always satisfied as the loop runs as the first character is read in E.G.
Number that is represented by the barcode
9780140301106
But as soon as the 9 is scanned the default condition is triggered
So it’s back to the drawing board any idea welcome on how to control the scanner
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I have not tried running your code but this caught my eye:
However with that in the fault condition is always satisfied as the loop runs as the first character is read in E.G.
Number that is represented by the barcode
9780140301106
But as soon as the 9 is scanned the default condition is triggered
If you run this routine off of the TextBoxIsbn_LostFocus() event instead of the change, it might be what you're looking for.

(With the change event, it'll trigger with each number that gets entered, with the LostFocus event it only triggers when you exit the textbox.)

Does that help?
 
Upvote 0
I have not tried running your code but this caught my eye:
If you run this routine off of the TextBoxIsbn_LostFocus() event instead of the change, it might be what you're looking for.

(With the change event, it'll trigger with each number that gets entered, with the LostFocus event it only triggers when you exit the textbox.)

Does that help?
Hi what version office you running as i can not see LostFocus in the list?

sounds just what i need if i can find it
regards pete
 
Upvote 0
I'm running 07 here but was using 03 with my first reply.
I also assumed you're using an ActiveX textbox planted directly on the sheet.
If you're actually using a textbox on a userform then you'd want to look for the Textbox_Exit event to tie your code to.

Either way, they both work the same in 07 & 03

That help?
 
Upvote 0
The text bos is on a user form, i am working on a work arround if you have any other ideas i would be glad of them
in the mean time just posting a realy odd problem

regards pete
 
Upvote 0
Your userform textbox doesn't show a Textbox_Exit event to use?

What version of Excel are you using?
 
Upvote 0
Textboxes have both Change and Exit events, in fact I think Change is the 'default' event.

Try double clicking the textbox while in Design mode.

Then use the dropdowns at the top of the code window to select the control and event.

Or is that what you are doing?
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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