nschroeder
nschroeder
- Local time
- Today, 16:31
- Joined
- Jan 8, 2007
- Messages
- 186
I found my question on a previous thread (2-21-2008), but am unable to get the answer to work for me.
I have an unbound form with several textboxes to receive search criteria (loan number or customer name), and a couple of subforms to display the requested loan and customer data. They want to key in a loan number, hit Enter, and have the focus stay in the loan number textbox, ready for the next number, but it wants to jump to the name. I tried SetFocus with no affect, so I searched your forum. The suggestion was to put
"If KeyCode = 13 Then KeyCode = 0"
in the loan number KeyDown event. However, this effectively cancels the entry. The focus stays in the textbox, but it doesn't process their request (as if they never hit Enter). I also tried setting the KeyPreview property in the Load event, but that didn't work, and I would think that wouldn't be what I want anyway, because I want the effect to apply to this control only, not the entire form.
What am I doing wrong? Thanks for your help.
I have an unbound form with several textboxes to receive search criteria (loan number or customer name), and a couple of subforms to display the requested loan and customer data. They want to key in a loan number, hit Enter, and have the focus stay in the loan number textbox, ready for the next number, but it wants to jump to the name. I tried SetFocus with no affect, so I searched your forum. The suggestion was to put
"If KeyCode = 13 Then KeyCode = 0"
in the loan number KeyDown event. However, this effectively cancels the entry. The focus stays in the textbox, but it doesn't process their request (as if they never hit Enter). I also tried setting the KeyPreview property in the Load event, but that didn't work, and I would think that wouldn't be what I want anyway, because I want the effect to apply to this control only, not the entire form.
What am I doing wrong? Thanks for your help.