将表单的宏转换为VB时出错 [英] Error converting form's macros to VB

查看:63
本文介绍了将表单的宏转换为VB时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序基于Access的标准Switchboard管理器创建的Switchboard打开 - 也就是说,由tbl SwitchboardItems驱动的表单,一个用于初始化其变量的OnOpen宏和一个调用OnClick宏的命令按钮启动所需的操作。


这个工作正常,但我现在想将宏转换为代码程序,以便给我一点灵活性。当我单击将表单的宏转换为Visual Basic时,在设计选项卡上,它会这样做并显示转换完成,但是当表单打开时,它会给出打开错误程序声明与具有相同名称的事件或过程的描述不匹配。 (附上截图)。

即使我删除了结果Sub的全部内容,它仍会得到相同的错误。如果我在将宏转换为VB之前删除OnOpen宏,它会在On Load,OnCurrent,OnClose阶段得到相同的错误。


我已经将宏转换为其他形式的VB代码成功。



My application opens with a Switchboard based on the one created by Access''s standard Switchboard manager - that is, a form driven by tbl SwitchboardItems, with an OnOpen macro to initialise its variables and a command button which invokes an OnClick macro to initiate the required action.

This has worked fine, but I now want to convert the macros to code procedures to give me a little more flexibility. When I click "Convert Form''s Macros to Visual Basic" on the Design tab, it does so and displays "Conversion Finished", but then when the form is opened it gives the On Open error "Procedure declaration does not match the description of event or procedure having the same name" (screenshot attached).
Even if I delete the entire contents of the resultant Sub, it still gets the same error. If I delete the OnOpen macro before converting the macros to VB, it get the same error at the On Load, OnCurrent, OnClose stages.

I have converted macros to VB code in other forms successfully.

附加图片
宏转换error.jpg (52.6 KB,275 views)
Attached Images
macro conversion error.jpg (52.6 KB, 275 views)

推荐答案

Hi Petrol


在设计视图中打开表单,查看代码是否编译。


Phil
Hi Petrol

Open the form in Design View and see if the code compiles.

Phil


不,它没有,消息(Microsoft Access无法创建ACCDE ...)暗示过多的表ID。

但请注意,即使我将所有已编译的代码从sub中取出,只留下t,我说同样的错误也会发生他遵循两个陈述:
No it doesn''t, the message ("Microsoft Access was unable to create the ACCDE ...") implying too many table IDs.
However, note that I said that the same error occurs even when I take all the compiled code out of the sub, leaving just the following two statements:
展开 | 选择 | Wrap | 行号


显然,错误消息与编译无关。该错误消息与将Accdb转换为Accde有关。


您确定刚刚在VBA中尝试了编译--->调试--->编译您的项目姓名?


Phil
Well obviously the error message has nothing to do with compiling. That error message is related to converting an Accdb to an Accde.

Are you sure you just tried a compile in the VBA--->Debug--->Compile your project name?

Phil


这篇关于将表单的宏转换为VB时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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