按钮将文件附加到对象OLE字段 [英] button attach file to Object OLE field

查看:43
本文介绍了按钮将文件附加到对象OLE字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(使用Access 2003)


我在表格中有一个对象OLE字段,用户可以在其中插入Excel工作表,Word文档,Pdfs等。

我需要在公式上创建一个按钮,允许用户浏览,选择和附加文件。该文件必须显示为可以双击打开的图标。该文件应存放在数据库中。


我可以出现一个对话框并浏览该文件并使用以下代码将路径复制到该字段中:

展开 | 选择 | Wrap | 行号

解决方案

(11.9 KB,2180 views)


谢谢你的效果非常好


@EJaques


非常欢迎你。


(Using Access 2003)

I have a an Object OLE field in a table where users can insert Excel sheets, Word Docs, Pdfs etc.

I need to create a button on a formulaire that allows the user to browse for, select and attach the file. The file must appear as an icon that can be double clicked on to be opened. The file should be stocked in the DB.

I can make a dialog box appear and browse for the file and copy the path into the field using this code:

Expand|Select|Wrap|Line Numbers

解决方案

@EJaques
Rather than go into a detailed explanation, I''ve created a simple Database and made it available to you as an Attachment. Clicking on the Insert OLE Object Command Button will:

  1. Open the Insert Object Dialog Box, from which you will:

    1. Select Create From File
    2. Browse ==> Select File to Insert ==> OK
    3. Select Display as Icon ==> OK

  2. The OLE Object will now be inserted into the OLE Object Field and displayed as an Icon.
  3. Double-Clicking on the Icon while in Form View will Open the File represented as an Icon in the Registered OLE Server for that File Type.
  4. No need for the File Dialog since the Insert Object Dialog will simply replace it.
  5. Good Luck, and Good Night!

Attached Files
OLE Object.zip (11.9 KB, 2180 views)


Thank you that works very well


@EJaques
You are quite welcome.


这篇关于按钮将文件附加到对象OLE字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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