Hi Tariq,
Did you try simply adding NODEFAULT to that textbox's KeyPress? In my case when I added NODEFAULT to Form's KeyPress I found that I am unable to type in the input controls at all.
>Dear Experts
>
>I have a textbox1 which gets input from Barcode scanner.
>I want this textbox not to accept input from keyboard.
>
>Background:
>
>I scan barcodes of new products and save in database.
>Some times user enters some wrong data into this textbox and save it in db.
>I want to block user to input any data in said textbox to ensure correct data is being entered.
>
>While googling I found this link similar to my problem
>
https://stackoverflow.com/questions/50464858/allow-only-barcode-scanner-and-eliminate-keyboard-input?noredirect=1&lq=1>
>But do no know how to make procedures workable in VFP.
>
>Please help
If it's not broken, fix it until it is.
My Blog