control (subform) being skipped on occassion

ehdoh

Registered User.
Local time
Yesterday, 19:47
Joined
Jun 24, 2003
Messages
58
I have a form with several subforms set up on a tab control. I am running into a problem where on every 2nd record/interview I go to enter, my 1st subform is skipped in the tab order and the user is jumped to the second subform (where they really needed to enter the first subform before moving to the second). So far this problem has not occurred when entering the first record/interview, but only when entering the second record/interview.

Here is the code being used to jump from the end of the form to the start of the first subform. The code below corresponds to two controls from the form, first from the very last control on the form (combo70) and then from the second to last control on the form (combo 71), whose answer determines whether to jump to the subform (DH_BevMeatSu) or to the last control on the form (combo70):

Private Sub Combo70_LostFocus()
Forms!DH_DairyForm.SetFocus
Forms!DH_DairyForm!DH_BevMeatSu.SetFocus
DoCmd.GoToControl "Combo14"
End Sub




Private Sub Combo71_LostFocus()
Select Case Me.Combo71
Case 1
DoCmd.GoToControl "Combo70"
Case "yes"
DoCmd.GoToControl "Combo70"
Case "y"
DoCmd.GoToControl "Combo70"
Case Else
Forms!DH_DairyForm.SetFocus
Forms!DH_DairyForm!DH_BevMeatSu.SetFocus
DoCmd.GoToControl "Combo14"
End Select
End Sub

I have tried using this code in both an AfterUpdate and LostFocus property, but both elicit the same problem. Any ideas how to cure this problem??

Thank you!
E.H.
 

Users who are viewing this thread

Back
Top Bottom