升级到Access 2010后代码已损坏 [英] Code has broken after upgrade to Access 2010

查看:84
本文介绍了升级到Access 2010后代码已损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从Access 2007升级到Access 2010(64位)。我已经解决了数据库中的一些小问题,但这一段代码只是不起作用。我不写VBA但对它有​​一个基本的了解。这段代码不是我写的,我仍然想知道为什么它不起作用?我已经发布了以下代码;它应该是这样做的:我有一个显示每条记录的主窗体。表单从一个组合一个主表和3个子表的查询运行。代码连接到弹出窗体上的按钮,单击该按钮时,将从其运行的所有表中删除主窗体上的当前记录。问题是什么都没发生?我甚至没有收到错误消息并请求调试?我希望这是一个简单的改变,与2007年的升级有关。任何帮助都表示赞赏。


谢谢

I have just upgraded to Access 2010 (64 bit) from Access 2007. There were a few minor issues in the database which I have resolved but this one piece of code just won?t work. I do not write VBA but have a rudimentary understanding of it. This code was not written by me and I am still trying to understand why it doesn?t work? I have posted the code below; this is what it is supposed to do: I have a main form that displays each record. The form is run from a query that combines one main table and 3 sub tables. The code is connected to a button on a pop-up form that when clicked, deletes the current record on the main form, from all the tables that it is run off. The problem is nothing happen? I don?t even get an error message and request to debug? I am hoping that it is a simple change that has to do with the upgrade as it worked in 2007. Any help is appreciated.

Thanks

展开 | 选择 | Wrap | 行号

推荐答案

在VBA编辑器中,单击代码左侧的灰色区域,在代码的第14行插入断点,然后尝试运行你的代码。如果正在运行您的代码,该行将以黄色突出显示(如果颜色是默认颜色)。如果没有,则按钮与其代码之间的链接被破坏。进入弹出窗体的设计视图,查看按钮的属性。单击省略号按钮(三个点)并确保它进入正确的过程。
In your VBA editor, click in the gray area to the left of the code to insert a breakpoint at line 14 of your code and then try to run your code. If your code is being ran, the line will be highlighted in yellow (if colors are the default colors). If not, then the link between the button and its code is broken. Go into the design view of your popup form and view the properties of the button. Click on the ellipsis button (the three dots) and make sure that it goes to the correct procedure.


我插入了断点并且没有任何更改。我也检查过它正在运行正确的事件程序。我应该说,单击按钮时唯一的想法就是关闭弹出窗体frmRecordControlBox。没有任何反应。
I have inserted the break point and nothing has changed. I also have checked it is running the right events procedure which it is. I should have said that the only think it does when I click the button is to close the pop-up form "frmRecordControlBox" and then nothing happens.


好的,所以代码正在运行。我的猜测是价值不是你所期望的。如果逐行执行代码,则可以在即时窗口中测试变量和属性。
Okay, so the code is running. My guess is that the values aren''t what you expect them to be. If you step through the code line by line, you can test your variables and properties in the immediate window.


这篇关于升级到Access 2010后代码已损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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