Greg
The PreviousControl property gives a reference to whatever control previously had the focus - so unless you're running the new Access Clairvoyant, how can it possibly workout what next control you had in mind!?!:):)
Something like this might work to give a reference to the control with the next tabindex:
Code:
Public Function NextControl(ctrlCurrent As Control) As Control
Dim intIndex As Integer
Dim ctrlFor As Control
intIndex = ctrlCurrent.TabIndex
For Each ctrlFor In ctrlCurrent.Parent
If ctrlFor.TabIndex = intIndex + 1 Then
NextControl = ctrlFor
End If
Next
End Function
It 'll need some error trapping to deal with controls that don't have a tabindex and you'll need to deal with controls with tabstop set to false and I'm not sure what to do if the current control is the last one on the form...
Brian Skelton
Braxis Computer Services Ltd.