Dug,
if the form.keypreview = .t. then the form.keypress method will get Everything first. Even before the valid. I know it works because this is what we use to do the same thing you are trying to use. The ~ is "thrown away" by the code I gave you and the rest is put into the barcode text box.
You could keep your existing stuff by simply removing references to .txtBarcode and set the focus to whatever text box you are normally getting input from. I do suggest you still clear it out before setting focus to it.
>I have a lot of code in the Valid method for the textbox and it seems that this fires after the "~" character is entered and the rest of the employee# does not have a chance to be received.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn