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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setfocus on one textbox

Status
Not open for further replies.

EBee

MIS
Aug 10, 2001
229
US
I only have one text box called txtContractNumber and when I enter a contract number and hit ENTER it does some things on the form tabs. The form does not have any other tab stops, I want it to setfocus on the item that i entered,so the next time I entered another number, it will delete the the previous number
 
EBee,
If I remember correctly, Access does not allow you to set the focus to the textbox that has the focus. If you have another textbox on the form, set the Exit event of the textbox1 to send the focus to textbox2. Then on the GotFocus event of textbox2, send the focus back to textbox1. If you don't have another textbox, command button, etc. that can receive the focus, create one and then see if you can hide it or disable it. Be careful as hidden or disabled objects may not be able to receive the focus. I don't believe objects such as labels can receive the focus either. Anyway, that's what the problem is and these are a few ideas to help accomplish what I think you are trying to do. Good luck!!

Phil
 
How are ya EBee . . . . .

There is a work around for this, but I need a few questions answered first.
[blue]I enter a contract number and hit ENTER it does some things on the form tabs[/blue]
1) Are you saying your using a Tab Control?

2) I assume some code is run(probably thru an event) to do whatever is being done on the tabs. Is this correct?

Need a brief description of whats being done.



Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top