>>What might the code look like?
>
>I tried the following for the "x" key, and it works as desired:
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>if nKeyCode = 120
> ThisForm.lBarCode = .T.
> NoDefault
>endif
>
>
>However, I don't find "~" in the table under inkey(); would it be possible to change to one of the symbols in the table?
>
>For "~", the inkey() function (inserted in another textbox for debugging purposes) gives 126; according to the table that might conflict with Alt-7, but I don't think that would be much of an issue either. Alt-7 doesn't even trigger the KeyPress!
I think if you also check nShiftAltCtrl it should eliminate any potential conflict with Alt-7
IF nKeyCode = 126 AND nShiftAltCtrl = 1
NODEFAULT
ENDIF
Bruce