在 Access 中维护模块/宏

发布于 2024-09-27 20:38:17 字数 267 浏览 3 评论 0原文

大家好,我编写了一个小模块/宏来帮助我们的库存部门,他们每个月都需要运行该模块/宏几次。他们从现场接收数据库,这些数据库是从我们拥有的第三方库存跟踪系统导出的。

我的问题是,有没有办法在 db 文件之外安装此模块/宏,但仍处于访问范围内,以便库存管理团队不必打开 vb 编辑器、导入模块、创建新宏、命名、设置它正确执行该功能?

模块/宏不需要针对任何新的数据库进行更改。

基本上,他们需要能够打开现场接收到的任何数据库,并在模块/宏中提供此功能,而无需进行设置。这可能吗?

Hey guys I've written a little module/macro that helps our inventory department, they will need to run the module/macro a few times every month. They receive the databases from out in the field these are exported from some 3rd party inventory tracking system we have.

My question, is there any way to install this module/macro outside of the db file but still within access so that the inventory management team does not have to open vb editor, import the module, create a new macro, name it, set it up properly to execute the function?

The module/macro does not need to be changed for any new database that comes in.

Basically they need to be able to open any database received by the field and have this functionality in the module/macro available to them without having to set this. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最笨的告白 2024-10-04 20:38:17

您可以查看我的 vb123.com 文章:

在 Access 应用程序中使用数据库库文件

这里的想法是,您可以将访问对象放入库文件中(仍然是 mdb 或 mde 文件,或任何新的访问文件类型),然后只需在 VBE 项目中添加对该文件的引用,您就可以得到该功能可供您使用。

它适用于表单、报告、查询、类等。说实话,我还没有尝试过使用宏,但不明白它不起作用的原因。

美妙之处在于可重用的功能被打包到一个文件中,该文件仍然只是一个普通的旧访问文件。

如果您愿意,您还可以编写一个访问添加,基本上调用库中的宏。

我们使用一个产品来实现这一点,该产品可以使 Access 中处理 SQL 变得更加容易,并且它已经在世界各地的 Access 安装中运行了多年。您可以使用专业的安装包(例如明智的安装)来安装该插件,从而为宏的最终用户提供非常无缝的体验。然而,以专业的方式编写这种设置需要相当大的开销。我想这取决于您的用户需要什么。

You could look at my article for vb123.com:

Using Database Library Files in Your Access Application

The thinking there is that you can put access objects in a library file (still an mdb or mde file, or any of the new access file types) and then by just adding a reference to the file in your VBE project, you get that functionality made available to you.

It works with forms, reports, queries, classes, etc. To be honest, I haven't tried it with macros, but don't see a reason why it wouldn't work.

The beauty is that reusable functionality is packaged into one file, that is still just a plain old access file.

If you had the inclination, you could also write an access add in that basically calls your macro in the library.

We did this with a product for making dealing with SQL much easier in Access, and it has worked for years with Access installations all over the world. You can install the add in using a professional installation package such as wise installation, making it a pretty seamless experience for the end user of your macro. However, there is a considerable overhead in writing this kind of setup in a professional way. Depends on what your users need, I suppose.

放血 2024-10-04 20:38:17

也许您正在考虑 VBScript 或后端、前端设置?

您可以使用 VBScript 通过 Access 对象、ADO 等对 Access 数据库执行操作。该脚本可以接受命令行输入、请求信息,也可以针对当前目录中的任何数据库运行。

对于后端前端,新数据库成为后端,带有宏的 Access 文件成为前端。您的宏应该询问用户后端文件的名称,然后根据需要执行的操作将其与 Access 对象一起使用或链接表。

Perhaps you are thinking of VBScript or a back-end, front-end set up?

You can use VBScript to perform actions on an Access database, through the Access object, with ADO and so on. The script can either accept command line input, request information, or run against any database in the current directory.

With back-end front-end, the new database becomes the back-end and the Access file with your macro is the front-end. Your macro should ask the user for the name of the back-end file and either use that with the Access object or link the tables, according to what is needed to be done.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文