将焦点设置子窗体 [英] Setting focus on a sub form

查看:299
本文介绍了将焦点设置子窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有嵌入控制两个子形式(就是那个看起来像一组文件夹,让您从标签变为标签......对不起,我不知道英文名字)..
两个子形式被嵌入到一张纸上,我想立即执行程序后,我写了子窗体中的一个,该组的重点则转到其他子窗体。 由于一些奇怪的原因,我不能得到它的工作。子窗体和字段我试图去是frmObjectives03和EFFECTIVE_DATE。

I have two sub forms embedded in control (the one that looks like a set of folders allowing you to change from tab to tab.. Sorry I don't know the name in English)..
Both sub forms are embedded on one sheet, I would like that immediately after executing a routine, I wrote on one of the subforms, that the set focus then goes to the other sub form. For some strange reason I can't get it to work. The sub form and field I'm trying to go to are frmObjectives03 and Effective_date.

我想:

Forms!frmObjectives03!Effective_date.Form.SetFocus

,但它不工作

but it doesn't work.

我会AP preciate任何见解。

I would appreciate any insight.

感谢您,

推荐答案

你说的控制是一个标签控件。

The control you speak of is a Tab control.

由于 frmOjective03 打开一个子窗体,它不是形式集合的一部分。相反,你可以使用表格!MainForm的!frmObjectives03.Form!Effective_date.SetFocus 从任何地方,或我!frmObjectives03.Form!Effective_date.SetFocus 从主窗体或 Me.Parent.Form!frmObjectives03.Form!Effective_date.SetFocus 从同级子窗体中。 如果这些工作不适合你,请检查子窗体控件的名称在您的主要形式(因为它可能是Child17代替frmOjective03)。在设计视图打开主窗体,单击窗体一次,看在属性 - >其他 - >名称。

Because frmOjective03 is opened as a subform, it is not part of the Forms collection. Instead you can use Forms!MainForm!frmObjectives03.Form!Effective_date.SetFocus from anywhere, or Me!frmObjectives03.Form!Effective_date.SetFocus from within the main form or Me.Parent.Form!frmObjectives03.Form!Effective_date.SetFocus from the sibling subform. If these are not working for you, please check the name of the subform control in your main form (because it may be Child17 instead of frmOjective03). Open the main form in design view, click on the subform ONCE and look in the Properties->Other->name.

这篇关于将焦点设置子窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆