fill in order

  • Thread starter Thread starter DL
  • Start date Start date
D

DL

Hi,

Since I made a lot of boxes in my form in a non logical order, the curser
follows this none logical order instead of going nicely from top to bottom.
Is there any way to set the order of the boxes the cursor has to jump to
when pressing for example the 'tab' button?

Thanks!
 
Hi DL

yes you can set the tab order
go into design view of your form
choose view / tab order
click AutoOrder (this will order the boxes from left to right, top to
bottom) - or move them in the order you want manually
click on OK and test it out

Hope this helps
Cheers
JulieD
 
Are you expecting the tab order to change? If not, there's no reason to
bother doing it programmatically.

If you are, you can set the tab index number in VBA for the various
controls.

If boolWhatever = True then
textbox1.tabindex = 0
textbox2.tabindex = 1
combobox3.tabindex = 2
else
textbox1.tabindex = 2
textbox2.tabindex = 0
combobox3.tabindex = 1
end if

grep
 
A couple of thoughts:

1. If you're running it off the control's OnClick event, you're not
firing it off unless you click the control with your mouse. But you're
trying to use tabs to reach each field. Perhaps you should consider
using the OnGotFocus event?

2. You're trying to set the tabindex for each control *as you tab to the
control*. By the time you've tab'd to it, though, the index is no longer
relevant. Maybe using the form's OnOpen event would help there? You'd
need to loop through all the fields, but it would only happen once when
the form opens.

3. Have you tried using the Auto Order button in the Tab Order menu? If
your fields are located on the form sequentially, it'll set all the tab
indexes properly and you won't have to worry about any of this.

grep
 
Back
Top