Tab stop after a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two forms and in each is a combo box to select the abbreviation for the state as part of an address. I have set up the tab sequence in each form. The tab stop after the combo box on both forms is zip code. One form work, (i.e., tabs to zip code) but the other does not. The one that does not work go to tab stop zero after the state combo box
Any ideas on what can cause this behavior? I do not know what to try next
Qui
 
Quin,

Is the Tab Stop property of the Zip Code control set to Yes?
Is there any macro or code on the State combobox, for example the After
Update event, which explicitly sets the focus to another control?
 
Answers
Is the Tab Stop property of the Zip Code control set to Yes
Yes. Tab index for State is 3 and ZIP is 4

Is there any macro or code on the State combobox, for example the After
Update event, which explicitly sets the focus to another control
No event code for State but ZIP has

Private Sub Location_ZIP_Click(
SendKeys "{HOME}
End Su

Private Sub Location_ZIP_Enter(
SendKeys "{HOME}
End Su
 
Quin,

Well, it's the SendKeys "{HOME}" code on the Enter event of the Zip
control that is causing this behaviour. What is the supposed purpose of
this code?
 
That code is there to move the cursor to the left most character in the field when the click on it or tab to it.
 
Quin,

Well, it doesn't. As you have discovered. :-)

Try this instead...
Me.Location_Zip.SelStart = 0
 
Quin,

To be precise, the other way didn't effect the tab order either! The
tab order was working fine. The focus was tabbing to the Zip textbox,
as required, and as soon as it got there, the Enter event issued a
SendKeys command to move the focus back to the beginning of the form.
 
Back
Top