I have a main form with a tab control. Each page of the tab control has a subform on it. When I click a tab I want the subform to have the first field selected, not where I was when I clicked to another page. I tried setting the focus to the field, I tried a select case for the change property of the tab control... nothing works all the time. The wrench in this is that when I tab out of the last field on each subform I set the focus to the first field on the next tab... that works. but if the user leaves the cursor in the last field on a subform and uses his mouse to click on the tab control to go to another page... when the user returns to the page where he left his cursor and then clicks anywhere else on that page, the event works and it jumps to the first field on the next page.
I have worked on this for days and been searching this site and the archieves to no avail. Maybe it's impossible.
PS I've also tried using the exit and lost focus events and keypress... the keypress will read a tab and go to the next page.. actually keypress works pretty well except that even though it's an event on the last field... if I tab into that field, that last field is skippeed complete (don't get a chance to type or tab) and it jumps to first field on next subform.
work? Of course you may not want to requery in which case I can't think how to approach it.
Thanks for the try but I tried that also.... I think I tried just about everything out there. What I have finally decided to to is put a button on each subform on each tab... the button will be last in the tab order and when clicked will take the user to the next page, so when/if the user returns to any page, clicking in a field will not activate the lost focus/exit I had on the last field and jump to the next one. I can't think of a reason for this not to work... in fact it will give the user more flexiblity in that if they don't click the button then can tab back thru the subform and make changes. Hopefully the boss will be ok with it.
This will show you what event fires everytime when switching between tabs
This is a great idea! It would help me learn when these events are actually happening and much faster then my hunt and peck approach. I am sure that I will have many opportunities to use this info. Thanks.