Access 2003中创建的宏/ VBA在Access 2013中不起作用 [英] Macros/VBA created in Access 2003 not working in Access 2013

查看:147
本文介绍了Access 2003中创建的宏/ VBA在Access 2013中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的Access数据库最近从2003年到2013年更新,这是一个相当大的跳跃。几个代码区域不再起作用,dbase的创建者已经退休。现在在.accdb中,我们在调试期间收到以下错误:


设置EmpInfo = QD.OpenRecordset(DB_OPEN_DYNASET)


此错误发生在以下代码。

Our Access database was recently updated from 2003 to 2013, which is quite a large jump. Several code areas no longer work and the creator of the dbase has since retired. Now in .accdb, we receive the following errors during debugging:

Set EmpInfo = QD.OpenRecordset(DB_OPEN_DYNASET)

This error occurs in the following code.

展开 | 选择 | Wrap | 行号

推荐答案

请告诉我们近200行的位置错误的代码,我们还需要知道错误消息的内容(确切的措辞)以及错误号。
Please tell us where in those almost 200 lines of code the error is and we also need to know what the error message says (exact wording) along with the error number.


>>>制作数据库的副本<<<


Seth绝对正确,我们需要代码行和

确切标题

确切数字

确切文字

你收到的错误信息


值得注意的是DB_OPEN_DYNASET是一个较旧的参考,在所示的上下文中,它不应该给你一个错误;但是,如果由于某种原因这是根本原因,以下内容应该有所帮助:


+打开VBE< alt>< F11>


+如果项目资源管理器尚未打开(默认)< ctrl>< r>


+打开任何代码页,无论是否' '形式,标准或类模块


+< ctrl>< h>

这将打开替换对话框


- 查找内容:DB_OPEN_DYNASET

- 替换为:dbOpenDynaset

- 搜索:当前项目

- 方向:全部

- 将所有其他设置留空

[全部替换]


+菜单>文件>保存

(或图标,或< ctrl>< s>)


++考虑在第120行和第121行之间插入
>>> Make a copy of your database <<<

Seth is absolutely correct, we need the code line and the
EXACT title
EXACT number
EXACT text
of the error message you receive

Of note the "DB_OPEN_DYNASET" is an older reference, in the context shown, it shouldn''t give you an error; however, if for some reason this is the root cause, the following should help:

+ Open VBE <alt><F11>

+ If the project explorer isn''t already open (default) <ctrl><r>

+ Open any code page, doesn''t matter if it''s a form, standard, or class module

+<ctrl><h>
This will open the Replace dialog

- Find What: DB_OPEN_DYNASET
- Replace With: dbOpenDynaset
- Search: Current Project
- Direction: All
- leave all other settings blank
[Replace All]

+ Menu>File>Save
(or the icon, or <ctrl><s>)

++ Consider inserting between line 120 and 121
展开 | 选择 | Wrap | 行号


错误在第102行。


错误显示,

运行时错误 '13'':

类型不匹配
The error is in line 102.

The error reads,
"Run-time error ''13'':
Type mismatch


这篇关于Access 2003中创建的宏/ VBA在Access 2013中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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