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

How to retrieve a click on a field on a tab 1

Status
Not open for further replies.

scklifasovskiy

Programmer
Nov 12, 2012
57
CA
Hi all,
I have a data entry form with pageframe that contains two tabs.
First tab has several fields to fill. Once user filling last field -- for a quick data entry they asked to swith automatically to second tab. So I am executing code on LostFocus() and all is fine. BUT now they want also this: if they filled last field on a first tab , but see mistake lets say in a second field and trying to correct the mistake -- they don't want to be switched obviously. What code should I execute on a LostFocus() of last field to know if they trying to come back to one of the fields?

Thanks
 
Place an extra control on the first tab. Set its tab order to be one higher than that of the last field on the first tab. Then put the code to move to the next tab in the new control's GotFocus (instead of the last control's LostFocus).

The new control could be a very small button that sits at the bottom of the form. You could even label it "Next page", so that if the user happens to click on it, its GotFocus will fire and it will have the desired effect.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike, but its not an option.
The goal is to make it automatic, I cannot introduce extra click. This for data entry people and most of the time they dont come back and want to be switched as soon as last field is done.
 
I'm not suggesting an extra click. My point was that the new control would be next in tab sequence after the last one on the page. So when they lose focus from that last control, it would automatically fire the GotFocus of the new one. I just mentioned the possibility of the user clicking on the new control in case they happened to do that.

Admittedly, they will need to take some action to actually lose focus from the last control, but they are presumably doing that already, under your existing scheme.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top