>You mention clearing properties in your initial entry...what properties? Also, you have a property that you seem to have defined that receives the ActiveControl. I don't have that property. Do I have to?
Dug,
In the 1st example I just copied some working code from our form.
The references to:
.CurrentPlace = .ActiveControl
.barcode = .t.
are used in our form to tell the valid where the input
came from and to return focus to the original text box
when done. You don't need them.
The thing that needs to be cleared is the input text box.
If someone has left something in the input text box, (say they started
to enter the code then decided to use the barcode instead,
or the didn't get a good reading the 1st time) then the
barcode value would be added to whatever was there resulting
in a bad code. Thus the code:
.txtEmplId.Value = ''
Put this code in the form keypress method.
Be sure to Set the form keypreview = .T. or this won't work.
The NoDefault will remove the ~ then the rest of the
barcoded input will go to the textbox you set focus to.
Use the name of your text box that gets the employee
id in place of .txtEmplId
If nKeyCode = 126
With Thisform
.txtEmplId.Value = ''
.txtEmplId.SetFocus()
EndWith
NoDefault
EndIf
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn