Is there a way to jump ahead in the tab order?
I have a form where the user enters an ID number. If the ID already exists,
the customer information is populated, and I'd like to skip to the shipping
address. I can't use SetFocus because I'm checking for the ID in the
CustomerID.BeforeUpdate event handler.
I tried setting ShippingAddress.TabIndex = CustomerID.TabIndex + 1, which
works, but the next tab tabs back to the customer fields.
Any ideas?
Thanks!
Joe
Ken Snell [MVP] - 27 Jan 2005 18:21 GMT
Why not use the Exit event of the control to move the focus to the desired
textbox when the customer info is "seen" in the respective textboxes? I
assume that those textboxes are empty if the ID doesn't already exist?

Signature
Ken Snell
<MS ACCESS MVP>
> Is there a way to jump ahead in the tab order?
>
[quoted text clipped - 10 lines]
> Thanks!
> Joe
Joe Holzhauer - 27 Jan 2005 18:28 GMT
I guess I wanted to avoid skipping ahead if the user clicked (or tabbed)
back into the ID field after the first time. I guess I could put a static
variable in there to record whether the ID has been searched before.
> Why not use the Exit event of the control to move the focus to the desired
> textbox when the customer info is "seen" in the respective textboxes? I
[quoted text clipped - 13 lines]
>> Thanks!
>> Joe
Ken Snell [MVP] - 27 Jan 2005 19:55 GMT
Yes, you'll need to somehow know when and if to skip ahead, so using a
variable or using a value in a hidden textbox on the form or something.

Signature
Ken Snell
<MS ACCESS MVP>
>I guess I wanted to avoid skipping ahead if the user clicked (or tabbed)
>back into the ID field after the first time. I guess I could put a static
[quoted text clipped - 18 lines]
>>> Thanks!
>>> Joe
Ken Snell [MVP] - 27 Jan 2005 20:07 GMT
Or to add to my other reply...
You could use the AfterUpdate event if you only want to skip ahead if the
person actually enters a value. This would avoid the skip if the person just
focuses on the control and then leaves it without changing anything.

Signature
Ken Snell
<MS ACCESS MVP>
>I guess I wanted to avoid skipping ahead if the user clicked (or tabbed)
>back into the ID field after the first time. I guess I could put a static
[quoted text clipped - 18 lines]
>>> Thanks!
>>> Joe
AlCamp - 27 Jan 2005 18:23 GMT
Joe,
Let the BeforeUpdate event pass a variable value to the AfterUpdate
event.
Ex. a Boolean variable called IDExists
BeforeUpdate can set IDExists to True or False, and AfterUpdate can use
that result to GoToControl... or not.
hth
Al Camp
> Is there a way to jump ahead in the tab order?
>
[quoted text clipped - 10 lines]
> Thanks!
> Joe