确定命令按钮打开表单 [英] Determine What Command Button Opens A Form

查看:80
本文介绍了确定命令按钮打开表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有主菜单,许多子菜单和一些

子子菜单的数据库。它们都是在它们上面有许多命令按钮的形式

来打开数据库中的表单和报告。

数据库有数百种表格和报告。我被要求通过菜单表单中的所有

并确定所有按钮是否都有效,如果表单或报表打开并且出现时有任何问题?

a数据库中不再使用的表单和报告列表。我通过打印

数据库中的表单和报告列表来启动此项目。当我浏览每个菜单时,我系统地点击了每个按钮,

确定了表格的名称或报告按钮打开,然后在列表中的名字中输入了
。我发现有很多表格和报告带有各种问题,我也在我的清单中标出了这些问题。我完成了所有这些。

问题需要修复。我从列表中知道每个表单或报告的名称,但我没想到。我没有注意如何将

导航到表单或报表。我需要在数据库中创建所有poroblem表单的列表,并为每个表单显示要转到哪个菜单表单以及该菜单表单上的
按钮打开形式有问题。例如:

MyForm MyMenuForm Cmd1032

HisForm HisMenuForm Cmd1243

HerForm MyMenuForm Cmd17


有没有以编程方式创建此列表的方法吗?


谢谢!


Steve

I am working on a database that has a main menu, many sub-menus and some
sub-sub-menus. They are all forms that have numerous command buttons on them
to open forms and reports in the database. The
database has hundreds of forms and reports. I was asked to go through all
the menu forms and determine if all the buttons worked, if there were any
problems when either the form or report opened and to come up with
a list of the forms and reports that were no longer used in the database. I
started this project by printing a list of the forms and reports in the
database. As I went through each menu, I systematically clicked each button,
determined the name of the form or report the button opened and then cheched
off the name in my list. I discovered there are many forms and reports with
various problems and I also marked those in my list. I''m done with all that.
The problems need fixed. I know the name of each form or report with a
problem from my list but I wasn''t thinking. I did not note how to navigate
to the form or report. I need to create a list of all the poroblem forms in
the database and for each form show which menu form to go to and which
button on that menu form opens the form with a problem. For example:
MyForm MyMenuForm Cmd1032
HisForm HisMenuForm Cmd1243
HerForm MyMenuForm Cmd17

Is there a way to programatically create this list?

Thanks!

Steve

推荐答案

Steve写道:
Steve wrote:

我正在开发一个拥有主菜单,许多子菜单和一些
$ b $的数据库b子子菜单。它们都是在它们上面有许多命令按钮的形式

来打开数据库中的表单和报告。

数据库有数百种表格和报告。我被要求通过菜单表单中的所有

并确定所有按钮是否都有效,如果表单或报表打开并且出现时有任何问题?

a数据库中不再使用的表单和报告列表。我通过打印

数据库中的表单和报告列表来启动此项目。当我浏览每个菜单时,我系统地点击了每个按钮,

确定了表格的名称或报告按钮打开,然后在列表中的名字中输入了
。我发现有很多表格和报告带有各种问题,我也在我的清单中标出了这些问题。我完成了所有这些。

问题需要修复。我从列表中知道每个表单或报告的名称,但我没想到。我没有注意如何将

导航到表单或报表。我需要在数据库中创建所有poroblem表单的列表,并为每个表单显示要转到哪个菜单表单以及该菜单表单上的
按钮打开形式有问题。例如:

MyForm MyMenuForm Cmd1032

HisForm HisMenuForm Cmd1243

HerForm MyMenuForm Cmd17


有没有以编程方式创建此列表的方法吗?


谢谢!


Steve
I am working on a database that has a main menu, many sub-menus and some
sub-sub-menus. They are all forms that have numerous command buttons on them
to open forms and reports in the database. The
database has hundreds of forms and reports. I was asked to go through all
the menu forms and determine if all the buttons worked, if there were any
problems when either the form or report opened and to come up with
a list of the forms and reports that were no longer used in the database. I
started this project by printing a list of the forms and reports in the
database. As I went through each menu, I systematically clicked each button,
determined the name of the form or report the button opened and then cheched
off the name in my list. I discovered there are many forms and reports with
various problems and I also marked those in my list. I''m done with all that.
The problems need fixed. I know the name of each form or report with a
problem from my list but I wasn''t thinking. I did not note how to navigate
to the form or report. I need to create a list of all the poroblem forms in
the database and for each form show which menu form to go to and which
button on that menu form opens the form with a problem. For example:
MyForm MyMenuForm Cmd1032
HisForm HisMenuForm Cmd1243
HerForm MyMenuForm Cmd17

Is there a way to programatically create this list?

Thanks!

Steve



号。


你之前问过这个问题。你不喜欢使用

OpenArgs的解决方案。

No.

You asked this question before. You didn''t like the solution using
OpenArgs.


你所要做的就是迭代命令栏集并打印出来。 />
按钮调用的报告/表格。


这不难做到。这里唯一的是你想要通过

菜单栏列出,还是只按报告分组? (如果您将结果数据发送到

a表,那么您可以按每个表格分组报告....


基本代码如下: br $>
Sub ListMyBars()


Dim cbar As CommandBar


每个cbar在CommandBars中

调用DisplayControls(cbar)

下一页


End Sub


Sub DisplayControls(cbar作为CommandBar)


Dim cControl As CommandBarControl


如果cbar.BuiltIn = False那么

每个cControl In cbar.Controls

Debug.Print cControl.Caption& _

" Action ="& cControl.OnAction& _

" form / reprot ="& cControl.Parameter


如果cControl.Type = 10那么

Debug.Print cControl.Caption&" ---->"

调用DisplayControls(cControl.CommandBar)

结束如果

下一页

结束如果


结束次级

Th以上e是递归的并且是呼叫。本身,因为菜单栏可以深入bb $ b级别。我可能会添加4-5行代码来将上述

数据发送到reocrdset。然后,您可以运行按表格/报告分组的报告。

-

Albert D. Kallal(访问MVP)

埃德蒙顿,艾伯塔省加拿大
pl ************* ****@msn.com
All you have to do is iterate the commandbars collection and print out the
report/form that the button calls.

It not hard to do this. the only thing here is do you want the listing by
menu bars, or simply grouped by reports? (if you send the resulting data to
a table, then you can report grouped by each form....

The basic code will look like:

Sub ListMyBars()

Dim cbar As CommandBar

For Each cbar In CommandBars
Call DisplayControls(cbar)
Next

End Sub

Sub DisplayControls(cbar As CommandBar)

Dim cControl As CommandBarControl

If cbar.BuiltIn = False Then
For Each cControl In cbar.Controls
Debug.Print cControl.Caption & _
" Action = " & cControl.OnAction & _
" form/reprot = " & cControl.Parameter

If cControl.Type = 10 Then
Debug.Print cControl.Caption & "---->"
Call DisplayControls(cControl.CommandBar)
End If
Next
End If

End Sub
The above is recursive and "calls" itself since menu bars can go "many"
levels deep. I would likely add a 4-5 more lines of code to send the above
data to a reocrdset. You thus can then run a report grouped by form/report.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com


" Salad" < oi*@vinegar.com写在留言中

新闻:wu ***************************** *@earthlink.co m ...
"Salad" <oi*@vinegar.comwrote in message
news:wu******************************@earthlink.co m...

> HerForm MyMenuForm Cmd17

有没有办法以编程方式创建此列表?

谢谢!

Steve
>HerForm MyMenuForm Cmd17

Is there a way to programatically create this list?

Thanks!

Steve



No.

你之前问过这个问题。你不喜欢使用

OpenArgs的解决方案。

No.

You asked this question before. You didn''t like the solution using
OpenArgs.



NO NO NO!


他不是要求修复/解决编码问题。他问他怎么能生成一个列表用于文档目的,显示什么是自定义菜单

bar

按钮调用什么形式或报告。这是一个大峡谷不同的问题。\\ b
问题。请参阅我对该解决方案的回复....


他不是试图修改现有代码,他也没有尝试使用现有的

代码知道 ;什么按钮称为代码,他只是想要一个他的

自定义菜单栏的列表,显示那些自定义菜单栏上的按钮叫什么

表格和报告...

-

Albert D. Kallal(访问MVP)

加拿大艾伯塔省埃德蒙顿
pl ***************** @ msn.com

NO NO NO!

He is not asking to fix/solve a coding problem. He is asking how can he
generate a list for documentation purposes that displays what custom menu
bar
button calls what form or report. This is a grand canyon DIFFERENT of a
problem. See my response for the solution....

He is not trying to modify existing code, nor is he trying have the existing
code "know" what button called the code, he simply wants a list of his
custom menu bars showing what buttons on those custom menu bars call what
forms and reports...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com


这篇关于确定命令按钮打开表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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