Solved

Insert a file in a bound object frame

Posted on 2003-11-10
3
750 Views
Last Modified: 2009-10-08
I want to insert a file ex. "c:\123.doc", in a automatic way, in i a bound object frame.
I have a record number, example  123, where I input various infos, then in this record (table) I need to insert (OLE) a file, but I don't want to use the keyboard or the mouse to do it. I want that this is made automatic.
Can you help me? The dabase picks the file in the positions identified by me and thens inserts it in the object frame.

Thanks,

Paulo Marques

0
Comment
Question by:paulo72
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
svenkarlsen earned 125 total points
ID: 9714450
Hi paulo72,

Example:

If you make a form with a bound object frame called BF1 and a button, then put these lines in the OnClick event code of the button:

Me.BF1.Class = "Word.document"
Me.BF1.OLETypeAllowed = acOLEEmbedded
Me.BF1.SourceDoc = "c:\test.doc"
Me.BF1.Action = acOLEEmbed

This will insert the document c:\test.doc in the frame.


Kind regards,
Sven
0
 
LVL 4

Expert Comment

by:inox
ID: 9714578

Create/use a table with an "OLE Object" type field.

design a form and insert a <Bound Object Frame> named eg "OLEFile" and a <textbox> named eg "txt1" for the filename and a <command button> named eg "Command1".
define a commandhandler for Button1 and write :

Private Sub Command1_Click()
  [OLEFile].Class = "Word.Document"
  [OLEFile].OLETypeAllowed = acOLEEmbedded
  [OLEFile].SourceDoc = [txt1]
  [OLEFile].Action = acOLECreateEmbed
  DoCmd.RunCommand acCmdRecordsGoToNew
End Sub

now the file is saved in the database.
0
 
LVL 4

Expert Comment

by:inox
ID: 9714591

Hi svenkarlsen
again the same thing, I have to become faster   :-(
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question