Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vba 如何查找打开的MS Access文件的文件路径_Vba_Ms Access - Fatal编程技术网

Vba 如何查找打开的MS Access文件的文件路径

Vba 如何查找打开的MS Access文件的文件路径,vba,ms-access,Vba,Ms Access,我有我自己创建的MS Access交换机,并试图找出如何在同一个交换机打开时找到它的文件路径。例如,如果它在桌面中打开以获取C:\Desktop等。 我真的不知道这是否可能,但如果有人知道如何在MS Access vba中实现这一点,那将非常有帮助 谢谢。尝试使用此选项在vba中获取当前路径文件 dim currentPath = CurrentProject.Path & "\" dim currentFileName = CurrentProject.Name dim fullPat

我有我自己创建的MS Access交换机,并试图找出如何在同一个交换机打开时找到它的文件路径。例如,如果它在桌面中打开以获取C:\Desktop等。 我真的不知道这是否可能,但如果有人知道如何在MS Access vba中实现这一点,那将非常有帮助


谢谢。

尝试使用此选项在vba中获取当前路径文件

dim currentPath = CurrentProject.Path & "\"
dim currentFileName = CurrentProject.Name
dim fullPath = currentPath & currentFileName

madmxg工作正常,但我也需要读取名称文件:(,我刚意识到我的问题首先是错误的。因此我需要C:\Desktop\Switcher 01.accde并使用CurrentProject.name获取文件名属性