Is there a way to determine the [TAB] direction?

C

Conan Kelly

Is there a way to determine the [TAB] direction (whether you are pressing
the [TAB] key to move forward through the fields on a form or [SHIFT] +
[TAB] to move backward through the fields)?

I have a hidden bound (to a field) control that is in the same spot the
"Category ID" field. When I "Category ID" loses focus, it becomes hidden
along with the next field, the hidden field becomes visible and gets the
focus. When the hidden field (now visible) loses focus, it is once again
hidden, the other two become visible again, and the second one gets the
focus.

The problem is that if I'm moving backward through the fields ([SHIFT] +
[TAB]), I go from the second visible field to the first visible field then
to the hidden field and then back to the second visible field. The only way
around this is to reach all the way over to the evil mouse and click.

I would like to be able to bypass the code that hides the visible
fields/makes visible the hidden field if I'm moving backward ([SHIFT] +
[TAB]) through the form.

Thanks for any help anyone can provide,

Conan Kelly
 
D

David C. Holley

Set the VISIBLE property for the field that should not be displayed to
FALSE then be certain to only post to one newsgroup. :)

David H
 
C

Conan Kelly

That really doesn't help much. Reread my post.

Also, what is wrong with posting to multiple newsgroups. It increases my
chances of getting an answer from someone who knows what they are talking
about.
 
A

Allen Browne

CategoryID is the one people see, and (say) txtCatID is the one behind it.

Set the TabStop for CateogryID to No, so the cursor doesn't go there when
tabbing through the form.

Set the Visible property of txtCatID to Yes: you don't see it because it's
behind the other one. Set its TabOrder so it receives focus at the right
time. When it gets focus, it jumps in front of the other one. No code
needed, and works both directions.
 
R

Rick Brandt

Conan said:
That really doesn't help much. Reread my post.

Also, what is wrong with posting to multiple newsgroups. It
increases my chances of getting an answer from someone who knows what
they are talking about.

There is nothing wrong with crossposting as long as you are conservative (3 or 4
groups maximum) and you pick groups that are relevant. Some people have seen
admonitions against multi-posting and/or excessive/inappropriate crossposting
and have gotten the impression that "one group and only one group" is the rule.
That is incorrect.
 
D

David C. Holley

The original post stated:
I have a hidden bound (to a field) control that is in the same spot the
"Category ID" field. When I "Category ID" loses focus, it becomes
hidden along with the next field, the hidden field becomes visible and
gets the focus. When the hidden field (now visible) loses focus, it is
once again hidden, the other two become visible again, and the second
one gets the focus.

If the intent is to HIDE (not display) the field described as hidden
then set the .VISIBLE property to false.

David H
 
J

John Spencer (MVP)

You could use the Screen.Previous Control to determine the object that did have
the focus and then make your decision on that basis. It still would not tell
you if you moused into the control or tabbed into the control.
 
C

Conan Kelly

John,

Thank you for your help.

I'm not familiar with this control. Where can I find it? How do I use it?

It sound like it might work for me. And I don't think it will matter that
it won't be able to tell whether I moused in or tabbed in.

Thanks again,

Conan Kelly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top