Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable copy/paste into form's textbox 1

Status
Not open for further replies.

Pcfred

Technical User
Jan 15, 2002
54
US
I need to disable the ability to paste(Ctrl+V) into a textbox on a form in Excel(VBA). Basically I have operators scanning barcodes into a textbox and I want to force them to scan the barcode and not copy/paste the data into the textbox.

any ideas?

Thanks in advance,
PcFred
 

Why not use a label instead? User cannot edit data in a label.

Have fun.

---- Andy
 
how do i set focus to a label so the scanner inputs the data?
 



Use the label CLICK event, or some other control logically related to the label.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
VBA will not allow tabbing to a from a textbox to a label which the scanner automatically does after inputing data.

Thanks anyway guys.
 

Cheat.
Put your text box outside of the Form's visible area so it is not visible to the user (if they cannot see it, they cannot modify it, right?), and in text box's _Change event put something like: Label1.Caption = TextBox.Text

You still can Set Focus to your text box.


Have fun.

---- Andy
 
that's sneaky and it just might work!

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top