使用命令按钮复制前端DB的VBA代码 [英] VBA Code to Copy front END DB using Command button

查看:95
本文介绍了使用命令按钮复制前端DB的VBA代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看VBA中是否有要复制的代码让管理员将数据库粘贴到另一个文件夹并让它重命名/覆盖此文件夹中的当前文件。我已经有办法让所有人离开数据库,所以我不需要考虑这部分。现在我手动完成它可能非常耗时。


我已经看过其他解决方案,但它们似乎让我的能力变得复杂。


感谢您提供给我的任何帮助。


Rhino

I''m looking to see if there is code in VBA to copy lets say an Admin database paste it to another folder and have it rename/Overwrite the current file in this folder. I already have a way to kick everyone off the database so I will not need to consider this part. Right now I do this manually and it can be very time consuming.

I have looked at other solutions and they seem to complicated for my abilities.

Thanks for any help you can give me.

Rhino

推荐答案

DJRhino1175,


使用文件系统对象,您可以非常广泛地移动,复制,重命名文件。您将需要添加Windows Scripting Runtime参考。简单地说:

DJRhino1175,

Using a File System Object, you can move, copy, rename files very extensively. You will need the Windows Scripting Runtime reference added. Simply put:

展开 | 选择 | Wrap | 行号


嗨犀牛。


虽然打开FileSystemObject并使用CopyFile是完全可能的,使用基本VBA库附带的FileCopy也是可能的,也可能更直接。


脚本很棒而且非常强大,但并不总是必要的。
Hi Rhino.

While it''s perfectly possible to open up a FileSystemObject and use CopyFile, it''s also possible, and probably more straightforward, to use FileCopy that comes with the basic VBA library.

Scripting is great and very powerful, but it''s not always necessary.


NeoPa,


请添加到我的工具包中。 />

我记得很多一年前我正在寻找的方式复制VBA中的内容,所有信息都指向FSO。


SO,你告诉我,我一直在浪费我的努力吗?


我觉得这样违反了!我想这就是我不知道标准VBA库中的所有东西所得到的!


DUH!


谢谢,伙计!现在我可以让我的东西更容易运行了!
NeoPa,

Please add to my tool kit.

I remember many a year ago when I was searching for how to copy stuff in VBA, and all info pointed to FSOs.

SO, yer tellin'' me that all this time I have been wasting my efforts with this???

I feel so violated! I guess that''s what I get for not knowing everything in the standard VBA library!

DUH!

Thanks, buddy! Now I can make my stuff more easier to run!


这篇关于使用命令按钮复制前端DB的VBA代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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