Hi, I have a form [frmDBT] that has a Tab Control with two pages, Threat (Page Index 0) and System (Page Index 1). The Threat page has four subforms and everything works well. I am able to navigate from the main form and the subforms on the page without difficulty. I hid blank text boxes inside the subforms with On Got Focus event procedures. The event procedures for the four subforms are:
1st subform: [frmsubScenario]
Parent.SetFocus
Parent.frmsubProbability.SetFocus
Parent.frmsubProbability!ProbabilityRating.SetFocus
2nd subform:[frmsubProbability]
Me.Parent.Rc1.SetFocus
3rd subform: [frmsubTree]
Parent.SetFocus
Parent.frmsubAttatchment.SetFocus
Parent.frmsubAttachment!Attachment.SetFocus
4th subform: [frmsubAttachment]
Me.Parent.Nomenclature.SetFocus
(I excluded the Private Sub Setfocus... and End Sub from the Event Procedures examples to save space on this post.)
The Second page, System, has problems. I can tab through all of the fields one time with no errors, but when I start to cycle through the fields a second time on the same record or begin cycling through the fields on a new record I get half way through and then get a run-time error 2110 that access can't move the focus to the control frmAttachments.
This page consists of one form frmsubTarget, which contains two additional forms: frmsubNarrative and frmsubOtherAttachments.
Similarly to the Threat page, I hid blank text boxes inside the subforms with On Got Focus event procedures. The event procedures for the two subforms are:
1st subform: [frmsubNarrative]
Parent!frmsubOtherAttachments.SetFocus
Parent!frmsubOtherAttachments.Form!OtherAttachment.SetFocus
2nd subform: [frmsubOtherAttachments]
Me.Parent.OtherName.SetFocus
The problem appears to be with the event procedure within the first subform. I have tried various things such as Parent.frmsubOtherAttachments.SetFocus
Parent.frmsubOtherAttachments.Form!OtherAttachment.SetFocus
and
Parent.Setfocus
Parent.frmsubOtherAttachments.SetFocusParent.frmsubOtherAttachments.Form!OtherAttachment.SetFocus
and
Forms!frmsubOtherAttachments.Form.SetFocus
Forms!frmsubOtherAttachments.form.controls(1).SetFocus
I also tried to incorporate this sample code
Forms(strForm).Controls(strSubform).Form.Controls(strControl).Value
that I borrowed from btabdevelopment but I couldn't figure out how to modify it correctly.
I would appreciate any suggestions, comments, references, etc that will assist me in figuring out this problem. I'm sure that this has been solved within this forum or others but I have not been able to find it yet.
Thanks,
Highworth
1st subform: [frmsubScenario]
Parent.SetFocus
Parent.frmsubProbability.SetFocus
Parent.frmsubProbability!ProbabilityRating.SetFocus
2nd subform:[frmsubProbability]
Me.Parent.Rc1.SetFocus
3rd subform: [frmsubTree]
Parent.SetFocus
Parent.frmsubAttatchment.SetFocus
Parent.frmsubAttachment!Attachment.SetFocus
4th subform: [frmsubAttachment]
Me.Parent.Nomenclature.SetFocus
(I excluded the Private Sub Setfocus... and End Sub from the Event Procedures examples to save space on this post.)
The Second page, System, has problems. I can tab through all of the fields one time with no errors, but when I start to cycle through the fields a second time on the same record or begin cycling through the fields on a new record I get half way through and then get a run-time error 2110 that access can't move the focus to the control frmAttachments.
This page consists of one form frmsubTarget, which contains two additional forms: frmsubNarrative and frmsubOtherAttachments.
Similarly to the Threat page, I hid blank text boxes inside the subforms with On Got Focus event procedures. The event procedures for the two subforms are:
1st subform: [frmsubNarrative]
Parent!frmsubOtherAttachments.SetFocus
Parent!frmsubOtherAttachments.Form!OtherAttachment.SetFocus
2nd subform: [frmsubOtherAttachments]
Me.Parent.OtherName.SetFocus
The problem appears to be with the event procedure within the first subform. I have tried various things such as Parent.frmsubOtherAttachments.SetFocus
Parent.frmsubOtherAttachments.Form!OtherAttachment.SetFocus
and
Parent.Setfocus
Parent.frmsubOtherAttachments.SetFocusParent.frmsubOtherAttachments.Form!OtherAttachment.SetFocus
and
Forms!frmsubOtherAttachments.Form.SetFocus
Forms!frmsubOtherAttachments.form.controls(1).SetFocus
I also tried to incorporate this sample code
Forms(strForm).Controls(strSubform).Form.Controls(strControl).Value
that I borrowed from btabdevelopment but I couldn't figure out how to modify it correctly.
I would appreciate any suggestions, comments, references, etc that will assist me in figuring out this problem. I'm sure that this has been solved within this forum or others but I have not been able to find it yet.
Thanks,
Highworth
Last edited: