如何引用驻留在子文件夹中的文件? [英] How to refer to files that reside in a subfolder?

查看:63
本文介绍了如何引用驻留在子文件夹中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我链接了子文件夹中包含的一堆图片。路径在表单的On Load和On Timer事件中定义。当表格打开时,每两秒钟33张图片从一张图片翻转到另一张图片。它运行得非常完美。


只有当我从我的电脑上复制数据库到我的笔记本电脑时,我才会收到错误信息,因为它会查找我的代码中定义的路径(例如?C:\ foldername \sbufoldername?等)。


如何修改代码使其成为通用代码,以便在将数据库的副本从一台PC传输到另一台PC时,所有图片的链接也将转移并且表格将打开没有错误消息。对此有任何帮助非常感谢。谢谢。


现在代码看起来像这样:

I have linked a bunch of pictures that are contained within a subfolder. The path is defined in the On Load and On Timer Events of a form. When the form is open, every two seconds 33 pictures flip from one to the other. It runs just perfect.

I get error message only when I make a copy of the DB from my PC to my laptop as it looks for the path as defined in my code (e.g.?C:\foldername\sbufoldername? etc. ).

How do I modify the codes to make it generic so that when a copy of the database is transferred from one pc to another, the links to all the pictures will also transfer and the form will open without an error message. Any help with this is much appreciated. Thanks.

Right now the code looks like this:

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

推荐答案

如果您将文件放在网络位置,并且您正在将数据库从一台联网的PC转移到另一台,那么这似乎不应该是一个问题。


如果您要将数据库从一台随机PC转移到另一台PC,而这些文件保存在每台PC的本地驱动器上,您似乎首先要提出一个文件对话框来询问用户JPEG的位置a如果确实你认为它可能适合你,那就不是一个困难的过程。


Pat
If you have the files in a network location, and you''re transferring the database from one networked PC to another, it seems like it shouldn''t be a problem.

If you are transferring the database from one random PC to another, where the files are kept on the local drive of each PC, it seems like you would first want to raise a file dialog to ask the user where the JPEGs are...not a difficult process if indeed you think it might work for you.

Pat


@ zepphead80


PAT:


感谢您的回复。我是新手,对VBA了解不多。我的代码是根据像你这样的各种大师的输入编译的。你能否给我一些关于如何编写代码的指导:
@zepphead80
PAT:

Thanks for your response. I am a novice and don''t know much about VBA. My codes are compiled based on input from various gurus like yourself. Can you give me some guidence on how to write the codes to:

引发一个文件对话框,询问用户哪里的JPEG是
raise a file dialog to ask the user where the JPEGs are






谢谢。

.

Thanks.


实现这一目标的最基本方法是

The most basic way to accomplish this is

展开 | 选择 | Wrap | 行号


这篇关于如何引用驻留在子文件夹中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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