How to set the tabindex with code

A

a

Hi,

Anybody knows how to set the tabindex of controls with code? I know you can
use the tabindex property but that does not work when you want to change the
tabindex of a lot of controls.
I don't like to use the normal way with the form with the names of the
controls where you drag them into the right order, because the list is not
wide enough to display the full names and it also forces you to use useful
names on the form, even in a case where that is not really neccessary. I
know that you can also use the Auto button, but you don't want to use that
button if the taborder you are trying to accomplish, is significant
different.
I have tried several things to do this with code, but the order is messed up
at the end.
For example:
Create a form with 10 textboxes. Give them the names txt1 to txt10.
Change the tabindexes for some textboxes by manually setting the tabindex
property or use the normal Access taborder form.
Who can tell me which code is capable of changing the tabindex back to the
corresponding texboxes?
It is probably something like this, but this does not work:

Dim intCount as Integer
For intCount = 1 to 10
Me("txt" & intCount).TabIndex = intCount
Next

I have also tried it with counting from 10 to 1 but that does not work
either.
Any ideas?
 
G

Guest

Did you check the TabIndex Property in VBA Help?
It shows you specifically how to do it.
 

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

Similar Threads


Top