Tiny bit of VB help needed!

Soldato
Joined
5 Aug 2006
Posts
4,261
I am sure there is something I am missing. It really cannot be that difficult, however my VB knowledge is shocking.

I have a form with a textbox (eg tbInput) and an ok button (eg btnOk)

What I would like, is when there user (or barcode scanner) has finished populating the textbox, and presses enter/return that the sub btnOk_Click is run.

I'm sure its real easy. But I have no idea how to do it! Using VB Express 2010 if that makes any difference.

Someones help would be much appreciated. :o

Kind Regards

Alec
 
Right, I just about get the first bit. Thanks for getting back to me, but need it in real simple terms as I've literally been programming in VB for half a day.

So in tbInput_KeyPress I've got

If System.Windows.Forms.Keys.Return = 1 Then

End If

So what goes in the middle to call up the code for the ok button?
 
Back
Top Bottom