Tab Control

Paul Cooke

Registered User.
Local time
Today, 12:27
Joined
Oct 12, 2001
Messages
288
Hi Guys is it possible to change a controls 'Tab Stop' setting through code.

1.cboCode - Tab index 0
2.txtProd - Tab index 1
3.txtQty - Tab index 2

When the form opens a new record controls 1 & 3 are enabled and tab stop is set to yes, control 2 is locked and tabstop is set to No.

If the users enters a cboCode then when they tab across the focus goes to the txtqty control.

However if they do not enter a code and hit tab I want the focus to go to txtProd to be the next control

Is this possible? and I am assuming that as the tab indexes are there enabling this one won't bugger up the order?

many thanks
 
However if they do not enter a code and hit tab I want the focus to go to txtProd to be the next control
I wouldn't bother coding the order and setting the Tab Stop.

Simply put in the Got Focus event:
Code:
If Me.txtBoxName.Locked = True
    Me.AnotherControl.SetFocus
End If
Leave the Tab Stop set to Yes.
 
Thanks for the reply not sure that I understand this though - I cannot use the Got Focus event as the control I want to have the focus is not in the Tab squence so when I tab out of the first control it will automaically go to the third control - or am i confusing myself?

Thanks
 
Get the name of the control you wish to set focus to and set focus to it in the Got Focus event of the control that can be potentially locked.
 
ahhh light bulb has just come on moment !!

many thanks again
 

Users who are viewing this thread

Back
Top Bottom