User form ENTER Key behavior.

rpaulson

Well-known Member
Joined
Oct 4, 2007
Messages
1,415
I have designed a form with about 5 user entry fields. One of the fields is an input for the drivers license from the customer. I have a card reader (Mag Strip) connected to the ps2 port via a keyboard wedge. Below is a sample of the raw data as it is read in.


%ohfremont^gates$bill$a^800 marvin apt 204^?
;4580231254111573=100719800510?


My issue is that the data has an ENTER (Second line ) key in it. When the form sees this ENTER keystoke it jumps to the next user input box.

Can I turn that feature off when the user is in the drives license field?

Ross
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Have you tried setting the text box's MultiLine property to true? (I assume you meant userform, not a worksheet form)
 
Upvote 0
I changed it to True but it acts the same way.

Basically what I need is. A way for the used to press enter but have the cursor stay in the same box.
 
Upvote 0
maybe a keyup event...check for enter key and handle as needed?
 
Upvote 0
Have you played with the .EnterKeyBehaviour property?
It will prevent the next control getting the focus when Enter is pressed.
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top