如何从代码模块中调用交换机? [英] How do I call a switchboard from within a code module?

查看:72
本文介绍了如何从代码模块中调用交换机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一段代码从交换机触发,要求输入密码,然后打开一个表单。


我想要打开自己的交换机。那是什么语法?

I have a piece of code that is triggered from a switchboard, asks for a password, and then opens a form.

I''d like it to open its own switchboard. What''s the syntax for that?

推荐答案

嗨苏。这取决于你所说的''交换机''。如果您自己设计了一个自定义交换机表单,则可以像在任何其他表单中一样打开它,方法是在VBA中使用DoCmd.OpenForm方法,从任何您想要启动它的表单或代码段中。


如果您的意思是想要打开或自定义标准向导设计的交换机的版本,那么简短的答案是,您将不明智地这样做,因为不同的交换机'您在交换机中看到的页面实际上是同一页面上的代码自定义变体,根据交换机向导例程构建的交换机选项表中存储的值,显示每个不同页面或子页面的标题和响应的更改。


可以在一定程度上自定义标准交换机,但是显示的按钮选项和选项的基本功能不能改变而不会失去使用管理交换机的能力内置向导。


-Stewart
Hi Sue. It depends what you mean by ''switchboard''. If you have designed a custom switchboard form yourself it can be opened like any other form by using the DoCmd.OpenForm method in VBA from within whatever form or code segment you want to launch it.

If you mean you want to open or customise a version of the standard wizard-designed switchboard the short answer is that you would be ill-advised to do so, as the different switchboard ''pages'' you see in the switchboard are actually code-customised variations on the same page, with changes to the captions and responses for each different page or subpage displayed according to values stored within a switchboard options table built by the switchboard wizard routines.

It is possible to customise standard switchboards to some degree, but the basic functionality of the button choices and options displayed can''t be altered without losing the ability to manage the switchboard using the built-in wizard.

-Stewart


我不想修改基本功能 - 我只是想创建一个交换机"子页面"只能通过一小段代码来打电话。


这里是图片:我有一个常规的主交换机,子页面和所有,以及其中一个选择调用一段要求输入密码的代码。一旦用户输入了正确的密码,我想建立一个有几个选项的子页面。 (这些选择每个都只是打开一个表格。)


就是这样。我会继续通过内置向导管理所有交换机页面,我不需要他们做任何棘手的事情。


您怎么看?
I don''t want to modify the basic functionality--I just want to create a switchboard "sub-page" that only gets call through a little piece of code.

Here''s the picture: I have a regular, main switchboard, with sub-pages and all, and one of the choices calls a piece of code that asks for a password. Once the user has entered the correct password, I''d like to put up a sub-page that has a couple of choices on it. (These choices would each just open a form.)

That''s it. I''d continue to manage all the switchboard pages through the built-in wizard, and I don''t need them to do anything tricky.

What do you think?


一般来说,由于交换机子页面不是独立的,所以不可能做你要求的事情。只有一种形式,您看到的子菜单都来自交换机的向导创建的代码以及存储所有交换机选项的表。


如果你看一下交换机表单的设计,它会显示为一组无空白的空白按钮。交换机向导创建的交换机表与表单上的活动代码一起确定当前显示的页面,要显示的按钮,按钮的标题以及响应于按下特定按钮。


尽管可以执行命令强制交换机执行特定选项,但这通常意味着你无法使用内置的''管理交换机的选项,如果你走这条路,可以进一步帮助你。


-Stewart
In general it is not possible to do what you ask, Sue, as the switchboard sub-pages are NOT independent. There is only one form, and the sub-menus you see are all arising from the switchboard''s wizard-created code in conjunction with the table storing all of the switchboard options.

If you look at the switchboard form''s design it appears as a set of uncaptioned blank buttons. The switchboard table created by the switchboard wizard in conjunction with the active code on the form determines which ''page'' is currently shown, which buttons to make visible, the captions for the buttons, and the options which are executed in response to a particular button being pressed.

Although it would be possible to execute commands to force the switchboard to execute a particular option, in general this would mean you could not use the built-in ''manage switchboard'' options to assist you any further if you go this route.

-Stewart


这篇关于如何从代码模块中调用交换机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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