×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Tab Stuck In Field

Tab Stuck In Field

Tab Stuck In Field

(OP)
What would make a tab press not advance to the next field? I have several fields on a form and when it gets to the 4th field and I press tab, it says in the 4th field and won't advance to 5th 6th and so on. If I click on next field, it then will tab to the rest. I checked all my user functions and I can't see anything wrong.

RE: Tab Stuck In Field

Some possibilities:

1. The next field has its TabStop property set to .F.

2. The next field has some code in its When event that is causing the problem (less likely).

3. The field from which you are trying to tab has some code its Valid event that is returning .F. (even less likely).

My money would be on the first of the above.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Tab Stuck In Field

It might also be that the fields' TabIndex properties are not what you expect. It could be that you are successfully tabbing out of Field 4, but the focus is going somewhere unexpected, such as a command button, rather than one of your fields.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Tab Stuck In Field

(OP)
Thanks Mike, I'll check those out. Seems reasonable.

RE: Tab Stuck In Field

I don't see how TabStop could be the issue. If every field after the 4th had TabStop = .F., tab would go back to the first field.

My guess is something in the Valid or LostFocus of the 4th field.

Tamar

RE: Tab Stuck In Field

Tamar, the reason I placed the possibility of Valid code in third place, and flagged it as "even less likely", is that he said that he had checked all the "user functions" and couldn't see anything wrong. But I agree that if the Valid was returning .F., that would explain the behaviour. Maybe "user functions" doesn't include methods or events.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Tab Stuck In Field

Is the 4th field an editbox? And is it set to AllowTabs=.T., then your tabs will show in the editbox text, though, and CTRL+TAB is necessary for moving the focus on.

You explicitly say you stay in the control, wrong tab order would do that, you'd still move on to somewhere else, Tabstop .f. in other controls, too.

Like Mike I don't know what you mean with user code, it could mean you looked into your own code within that control. But is it a class? Did you look into class code, parent class code? Alos of the next control, which can reject getting focus in the WHEN event. And you can of course get stuck in a control by it either not allowing focus change in valid or lostfocus. If this is legacy code, the ErrorMessage event might be used instead of the Valid.

In such situations you don't see what happens, but what happens is not normal, it helps to look at what runs, as there is too much places to look into source code. Either single-stepping through code with the debugger or recording with COVERAGE. It's hard to decide where to start with the debugger it and the influence of the debugger window causing focus changes also doesn't help about such situations. So SET COVERAGE TO coverage.log and then see what happens, I bet you find the reason.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: Tab Stuck In Field

Hello,

I would bet on Mike's 1. tabstop set to .f. or Mike's Post 4 with unexpected taborder
because he writes he can leave the field with click, so to my opinion it cannot be lostfocus or valid or when code.

Tom

RE: Tab Stuck In Field

(OP)
Found it! It's an unknown error in a class called "acombo". I changed it to a simple combobox and it was happy. Thanks for the help.

Just fyi, when I referred to user code, it should have said "User Procedures" within the objects.

Thanks.

RE: Tab Stuck In Field

Glad you found it, but could you clarify what you mean by "an unknown error". This could be useful for other people to know, and it would also satisfy my curiosity.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close