无法在Access 2010中编辑或重新保存现有的事件驱动的数据宏 [英] Cannot edit or re-save an existing event-driven Data Macro in Access 2010

查看:135
本文介绍了无法在Access 2010中编辑或重新保存现有的事件驱动的数据宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(这是在此处的一个较早问题的答案的后续内容.)

(This is a follow-up to an answer from an earlier question here.)

我有一个Access 2010数据库文件,其中包含带有Before Change数据宏的表:

I have an Access 2010 database file containing a table with a Before Change Data Macro:

我可以在数据表视图中打开表并添加行,并且数据宏的行为符合预期.但是,如果我在设计视图"中打开表,打开数据宏"进行编辑,做一些琐碎的事情,例如单击其中一个宏步骤旁边的[+]来展开详细信息,然后尝试保存更改"即可.错误

I can open the table in Datasheet View and add rows, and the Data Macro behaves as expected. However, if I open the table in Design View, open the Data Macro for editing, do something trivial like click the [+] beside one of the macro steps to expand the details, and then try to save the "changes" I get the error

"LookUpRecord"宏操作的"Look Up A Record In"自变量值无效.

The 'LookUpRecord' macro action has an invalid value for the 'Look Up A Record In' argument.

我还尝试在全新的Access 2010 .accdb中从头开始创建宏,并得到相同的错误.我已经在三台不同的计算机上对此进行了测试:两台运行64位Access 2010的计算机和一台运行32位Access 2010的计算机.所有计算机都通过Microsoft Update进行了完全修补. (也就是说,它们当前正在运行版本14.0.7106.5003.)

I have also tried to create the macro from scratch in a fresh Access 2010 .accdb and get the same error. I have tested this on three different machines: two machines running 64-bit Access 2010 and one machine running 32-bit Access 2010. All machines are fully patched via Microsoft Update. (That is, they are currently running version 14.0.7106.5003.)

在进行测试时,我注意到这似乎与事件驱动的数据宏有关,该宏试图使用LookUpRecord在适用于数据宏的相同表上执行SELECT.在某些 other 表上执行SELECT似乎不会触发错误.

While testing I noted that this appears to be related to an event-driven Data Macro trying to use LookUpRecord to perform a SELECT on the same table to which the Data Macro applies. Performing a SELECT on some other table does not seem to trigger the error.

我的问题是:

  1. 任何人都可以使用Access 2010的修补程序版本来重新创建此问题吗?

  1. Can anyone recreate this issue with a patched version of Access 2010?

谁能用Access 2010的未修补版本(例如,早期版本中的全新安装)测试此功能,以查看后续修补程序 broke 是否有所更改?

Can anyone test this with an unpatched version of Access 2010 (e.g., fresh install from an early release) to see if a subsequent patch broke changed something?

任何人都没有看过任何文档或Internet聊天建议建议某个表的事件驱动数据宏应该(或应该 not )能够通过自己执行SELECT来执行LookUpRecord吗?

Has anyone seen any documentation or Internet chatter to suggest that an event-driven Data Macro for a particular table should (or should not) be able to do a LookUpRecord by performing a SELECT on itself?

编辑-2013年12月19日14:10 UTC:

我刚刚使用Access 2010 SP1(14.0.6023.1000)进行了测试,并得到了相同的结果.

I just tested this with Access 2010 SP1 (14.0.6023.1000) and got the same results.

推荐答案

我认为问题在于表别名.如果在布局模式下打开表(只需在设计模式下不打开表).然后,您会得到:

I think the issue is the table alias. If you open the table out in layout mode (just open the table NOT in design mode). You then get this:

您现在可以自由编辑宏(例如展开操作),然后保存宏.

You can now edit the macro freely (such as expand an action) and then save the macro.

我怀疑这是一个意外的错误,因为如果在设计模式下打开表,则表将被锁定,并且宏无法获取/检查在lookup命令中使用的SQL.

I suspect this is an un-intended bug since if the table is opened in design mode then the table is locked and the macro cannot get/check verify the SQL used in the lookup command.

请注意,如果您只需将表名放在宏设计器中,那么您就不会有问题,在这种情况下,这就是99%的人要做的事情.

Note that if you JUST PLACE the table name in the macro designer then you have NO problem and this is what 99% of people do in this case.

大多数人不知道您可以在此处释放SQL的手动输入!!!

Most most don't know you can free hand type in SQL here!!!

在保存时,设计人员尝试针对该表验证SQL-但该表已锁定在设计模式下.因此,从某种程度上讲,这是一个错误,但是由于很少有人在该查询记录命令中键入SQL而很少遇到它.

Upon save the designer attempts to verify the SQL against the table – but the table is locked in design mode. So in a round about way, this is a bug, but few encounter it due to few typing in SQL into that lookup record command.

如上所述,我只是通过单击打开表格,而不使用设计模式进行更改.并注意上面的屏幕快照中,在设计模式下打开表格时,事件按钮是如何分离的按钮,然后更容易被按下.

I would as noted just open up the table by clicking on it and not use design mode to make changes. And note in the above screen shot how the event buttons are separate buttons and easier to hit then when opening table in design mode.

请注意,为了直接从数据表视图直接编辑数据宏,数据库必须启用在数据表视图中启用表的设计更改"选项:

Note that in order to edit the Data Macros directly from Datasheet view the database must have the "Enable design changes for tables in Datasheet view" option enabled:

如果未设置该选项,则在数据表"视图中将禁用数据宏"按钮.

If that option is not set then the Data Macro buttons are disabled in Datasheet view.

这篇关于无法在Access 2010中编辑或重新保存现有的事件驱动的数据宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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