a.phillips
Registered User.
- Local time
- Today, 02:03
- Joined
- Jul 19, 2011
- Messages
- 37
I am using Access 2003 as a front end, and SQL server management studio 2008 as back end.
I recently migrated the data from Access 97 (where the tabbing order worked fine).
In 2003 I have a problem with the tab order. If the user presses enter I want it to skip to the textbox in the subform, however if it is the last textbox in the subform, I want the focus to be set to first text box in the next subform. If the user presses tab (on any textbox), I wish it to go to the next subform.
The problem is when it sets the focus to the next subform, it misses the first field out, even though it is specified in the code, which textbox to set the focus to.
Here is what I have done so far:
- I have checked that the tabbing order is correct.
- In the code I have set the focus to the subform, before setting the focus to a field in the subform.
- I have tried setting the focus to another object, then to the desired object, this does not work.
- I have tried me.requery and me.refresh before setting the focus (This works on some objects but not all).
Here is the example of the code I have behind a text box:
Private Sub Lipid_Therapy_Combo_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyTab Then
Me.Refresh
Me.Requery
[Forms]![info 2009]![other 2009].SetFocus
[Forms]![ info 2009]![other 2009]![Other 1].SetFocus
End If
End Sub
This workes on all of the textboxes in the subform, except for the one (the first one).
Does anyone have any suggestions on what to try?
Thanks
I recently migrated the data from Access 97 (where the tabbing order worked fine).
In 2003 I have a problem with the tab order. If the user presses enter I want it to skip to the textbox in the subform, however if it is the last textbox in the subform, I want the focus to be set to first text box in the next subform. If the user presses tab (on any textbox), I wish it to go to the next subform.
The problem is when it sets the focus to the next subform, it misses the first field out, even though it is specified in the code, which textbox to set the focus to.
Here is what I have done so far:
- I have checked that the tabbing order is correct.
- In the code I have set the focus to the subform, before setting the focus to a field in the subform.
- I have tried setting the focus to another object, then to the desired object, this does not work.
- I have tried me.requery and me.refresh before setting the focus (This works on some objects but not all).
Here is the example of the code I have behind a text box:
Private Sub Lipid_Therapy_Combo_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyTab Then
Me.Refresh
Me.Requery
[Forms]![info 2009]![other 2009].SetFocus
[Forms]![ info 2009]![other 2009]![Other 1].SetFocus
End If
End Sub
This workes on all of the textboxes in the subform, except for the one (the first one).
Does anyone have any suggestions on what to try?
Thanks