On Wed, 12 Oct 2011 14:28:56 +0100, Mo <(E-Mail Removed)> wrote:
>Hello,
>
>I'm trying to set the focus to a control on a subform from another
>subform and I'm using the following:
>
>Private Sub cmbMParentSiblings_Exit(Cancel As Integer)
>
>Forms!frmperson!frmFatherSub.Form!cmbFather.SetFocus
>
>End Sub
>
>It doesn't work. There's no error message, but the focus just cycles
>back through the controls on the first subform.
>
>What am I doing wrong?
>
>TIA for any help.
Oddly, you need TWO Setfocus steps in sequence: first setting focus to the
Subform itself, then to the control on that subform. Try
Forms!frmperson!frmFatherSub.SetFocus
Forms!frmperson!frmFatherSub.Form!cmbFather.SetFocus
Alternatively, you can use the Parent! shortcut rather than the full parent
form reference:
Parent!frmFatherSub.SetFocus
etc.
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also
http://www.utteraccess.com