文件浏览窗体上的按钮 [英] file browse button on a form

查看:122
本文介绍了文件浏览窗体上的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我一直在研究Access 2003中的一个项目,它需要选择一个excel文件(通过浏览文件夹,然后选择一个文件),选中文件名将出现在文本框中。


这将全部发生在表格上。


我不知道浏览到文件会很复杂。经过几个小时的搜索,我想我已经找到了我需要的信息,但不确定如何让它真正起作用。 http://www.mvps.org/access/api/api0001。 htm


对于相对较新的Access,我仍然不清楚如何实现此代码,或者如何将其连接到表单上的按钮等。 />

我猜想需要创建一个模块,然后调用代码中的特定函数,但这只是猜测。


任何帮助我会很感激。

Hello,

I have been working on a project in Access 2003, that requires an excel file to be selected (via browsing through folders, then selecting a file), the selected file name will then appear in a text box.

This will all take place on a form.

I had no idea browsing to a file would be so complicated. After many hours of searching I think I have found the information I need but unsure as to how to make it actually work. http://www.mvps.org/access/api/api0001.htm

Being fairly new to Access still I have no clue as to how to implement this code, or how to connect it to a button on a form etc.

I would guess that a module will need to be created then a specific function in the code be called but that is just guesswork.

Any help would be appreciated.

推荐答案


你好,


我去过在Access 2003中处理项目,需要选择一个excel文件(通过浏览文件夹,然后选择一个文件),所选文件名将出现在文本框中。


这将全部发生在表格上。


我不知道浏览文件会如此复杂。经过几个小时的搜索,我想我已经找到了我需要的信息,但不确定如何让它真正起作用。 http://www.mvps.org/access/api/api0001。 htm


对于相对较新的Access,我仍然不清楚如何实现此代码,或者如何将其连接到表单上的按钮等。 />

我猜想需要创建一个模块,然后调用代码中的特定函数,但这只是猜测。


任何帮助不胜感激。
Hello,

I have been working on a project in Access 2003, that requires an excel file to be selected (via browsing through folders, then selecting a file), the selected file name will then appear in a text box.

This will all take place on a form.

I had no idea browsing to a file would be so complicated. After many hours of searching I think I have found the information I need but unsure as to how to make it actually work. http://www.mvps.org/access/api/api0001.htm

Being fairly new to Access still I have no clue as to how to implement this code, or how to connect it to a button on a form etc.

I would guess that a module will need to be created then a specific function in the code be called but that is just guesswork.

Any help would be appreciated.



如果没有实际实现网站上发布的代码,我无法告诉你该怎么做。我在下面提供的链接具有可以下载的浏览功能的mdb文件。源代码随下载一起提供,并且更容易实现。


浏览并打开文件数据库
http://www.utterangel.com/utterangel.aspx#8

没有ActiveX的文件打开对话框
http://www.fabalou.com/Access/Module...pen_dialog.asp


如果您有任何问题,请告诉我。

Without actually implementing the code that is posted on the web site, I could not tell you what to do for sure. The links I am providing below have working mdb files with the browse function that you can download. The source code is provided with the download and is much easier to implement.

Browse and Open Files Database
http://www.utterangel.com/utterangel.aspx#8

File Open Dialog Boxes without ActiveX
http://www.fabalou.com/Access/Module...pen_dialog.asp


Let me know if you have any problems.


谢谢!


我会检查出来并回复你。
Thanks!

I''ll check them out and get back to you.


所以我认为你发给我的第二个例子会很好用


档案没有ActiveX的打开对话框

http://www.fabalou.com/Access/Modul...open_dialog.asp


但是我碰到了一个小的问题。


如果我点击请选择一个Excle文件浏览按钮我得到这个错误:


无效使用Null(错误94)


以下是调试的内容:


Me.txtXLFIle.Value = FindFile(Me.txtDir.Value,请选择Excel文件,Excel文件,*。xl? )


奇怪的是,当我选择第一个按钮请选择目录时它工作正常然后如果我选择请选择一个Excel文件之后,它的工作原理应该如此。


有什么想法吗?
So I think the second example you sent me will work nicely

File Open Dialog Boxes without ActiveX
http://www.fabalou.com/Access/Modul...open_dialog.asp

but I ran into a small problem.

If I click on the "Please Select an Excle File" browse button first I get this error:

Invalid use of Null (Error 94)

and the following is what comes up with the Debug:

Me.txtXLFIle.Value = FindFile(Me.txtDir.Value, "Please Select an Excel File", "Excel Files", "*.xl?")

The strange thing is that when I select the first button "Please Select a Directory" it works fine and then if I select the "Please Select an Excel File" after, it works like it should.

Any thoughts?


这篇关于文件浏览窗体上的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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