如何在同一个选项卡控件中调用另一个表单上的subs? [英] how to call subs on another form in the same tab control?

查看:69
本文介绍了如何在同一个选项卡控件中调用另一个表单上的subs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格''frmHome''。它有一个标签控件''tabCtrl''。选项卡控件有两种形式:''frmContacts''和''frmProjects''。


在联系表单上,我可以看到一个人参与的项目。在项目表单中,我可以看到与项目相关联的人员。


我想从联系人表单中点击项目,然后让我把它带到项目表单上的那个项目。我想同样点击项目表单上的某个人,然后将它带到联系表单上的那个人。


到目前为止,我可以通过dbl点击一个项目联系人表单,代码将使用项目表单将选项卡控件更改为适当的页面。此外,项目页面上有一个public sub,它将当前记录设置为全局变量的值。我用命令按钮测试了那个sub,它运行得很好。


但是我无法弄清楚如何从另一种形式调用那个公共子。我无法弄清楚引用它的正确语法。


帮助?谢谢。

I have a form ''frmHome''. It has a tab control ''tabCtrl''. The tab control has two forms: ''frmContacts'' and ''frmProjects''.

On the contacts form I can see the projects a person is involved with. On the Projects form I can see the people associated with a project.

I want to dbl-click on a project from the contacts form, and have it take me to that project on the projects form. I want to similarly click a person on the projects form, and have it take me to that person on the contacts form.

So far, I can dbl-click on a project in the contacts form, and the code will change the tab control to the appropriate page with the projects form. Also, there is a public sub on the projects page which will set the current record to the value of a global variable. I tested that sub with a command button and it works great.

BUT - I can''t figure out how to call that public sub from the other form. I can''t figure out the proper syntax to reference it.

Help? Thanks.

推荐答案

你输了我。


你应该在参考子表单上的项目以帮助解决此问题。如果没有,那么尝试用明确的术语进一步解释你的需求。
You should find enough reference material in Referring to Items on a Sub-Form to help with this. If not then try to explain what you need further in clear terms.


从VBA代码中你可以引用另一个开放形式的 public 子或函数(frmProjects)在这种情况下)如下:

From VBA code you can refer to a public sub or function in another open form (frmProjects in this case)as follows:

展开 | 选择 | Wrap | 行号


这篇关于如何在同一个选项卡控件中调用另一个表单上的subs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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