If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Where is the next control identified?
Screen.PreviousControl.Name provides the name of the control that last had
the focus. That's nice if you need to know where control came from, but there doesn't seem to be a Screen.NextControl.Name or anything similar. I have code that is executed OnLostFocus in which I would like to save the name of the control that will be receiving the focus. This would allow me to force the focus to some other control and then, after the required processing of that control has finished, restore the focus to the control indicated by the user. |
#2
|
|||
|
|||
Where is the next control identified?
On Tue, 10 Nov 2009 20:48:07 -0800, Chuck
wrote: A simple solution would be to iterate over the Controls collection, checking the TabIndex property: dim ctl as control for each ctl in me.controls if ctl.TabIndex = Me.myControl.TabIndex + 1 then Msgbox "The next control is " & ctl.Name next (of course you replace myObjectNames with yours) Oh, but what if I used the mouse to move focus 3 controls ahead? Your requirement is VERY curious. I think you are saying that when I tab out of a control, you want OnLostFocus set focus somewhere else, then set it to where I wanted to go in the first place. What's the point of this side-step? Which would probably only last milliseconds? Show us some code (stripped to the bare essentials) and we may be able to suggest a better way. -Tom. Microsoft Access MVP Screen.PreviousControl.Name provides the name of the control that last had the focus. That's nice if you need to know where control came from, but there doesn't seem to be a Screen.NextControl.Name or anything similar. I have code that is executed OnLostFocus in which I would like to save the name of the control that will be receiving the focus. This would allow me to force the focus to some other control and then, after the required processing of that control has finished, restore the focus to the control indicated by the user. |
Thread Tools | |
Display Modes | |
|
|