Tab order

  • Thread starter Thread starter Joe Holzhauer
  • Start date Start date
J

Joe Holzhauer

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
 
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?
 
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
 
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.
 
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.

--

Ken Snell
<MS ACCESS MVP>
 
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.
--

Ken Snell
<MS ACCESS MVP>
 
Back
Top