Do not use on any
shared computer
August 30, 2008 02:16am pdt
 
[x]
Attachment Details

How to Change SourceDoc for Unbound Object Control in MS Access 2003 Report

Tags: Microsoft, Access, 2003, Changing SourceDoc for Unbound Object Control in Report, MS Access VBA, N/A, N/A
I am developing an application in Access 2003.  It has a table that lists various information about clients.  One of the fields is a text field that has the path to an attachment for that client.  It could be a Word document, a Visio drawing, Adobe document, jpg file, etc.  None of these attachements are that big and there is only one per client.  I want to print the attachment in a report so I have inserted an unbound object frame control in the report.  I have tried to change the SourceDoc property of this control with no success.  I have read several Experts Exchange question/answers and Googled this but have not been able to change it.  When I create the control I need to specify a document and it seems I can't get rid of the original document no matter what I do.

Thank you in advance for your help.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
 
Dim filePath as string
Dim drawingCtl As ObjectFrame
Set drawingCtl = Me!OLEUnbound29
 
' I will reference the field contents to get the filePath but for
' now I am just hard coding it in to try to get it to work. 
filePath = "C:\NetworkDiagrams\Diagram08.vsd"
 
drawingCtl.OLETypeAllowed = acOLELinked
drawingCtl.Class = "Visio.Drawing.11"
drawingCtl.SourceDoc = filePath
' This next statement produces an error 
' Without this statement nothing happens at all
drawingCtl.Action = acOLECreateLink
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Software
Question Asked By: LynnBertrand
Solution Provided By: harfang
Participating Experts: 2
Solution Grade: A
Views: 45
Translate:
Loading Advertisement...
 
[+][-]Author Comment by LynnBertrand
Author Comment by LynnBertrand:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by harfang

Rank: Wizard

Expert Comment by harfang:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by LynnBertrand
Author Comment by LynnBertrand:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by harfang

Rank: Wizard

Expert Comment by harfang:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by boag2000

Rank: Wizard

Expert Comment by boag2000:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by LynnBertrand
Author Comment by LynnBertrand:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by harfang

Rank: Wizard

Expert Comment by harfang:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by LynnBertrand
Author Comment by LynnBertrand:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by boag2000

Rank: Wizard

Expert Comment by boag2000:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by harfang

Rank: Wizard

Accepted Solution by harfang:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Open Discussion
Open Discussion
 
Comment by LynnBertrand
Thank you to you both.  I wish Microsoft would let me do what I originally wanted to!
 
 
Comment by boag2000
;-)
 
 
Comment by boag2000
LynnBertrand ,

One final note:

Access 2007 has a  new "attachment" datatype.
My guess is that this new data type is supposed to address some of the short falls of OLE Fields.
I have 2007 at work but have not tried this out yet.
As Allen Browne states (http://allenbrowne.com/Access2007.html#Mixed) using these fields could easily push you to the 2 gb limit fairly quickly.
One other thing that is unclear is whether or not this new datatype has, or will have, a corresponding datatype in SQL server (or MySql)

I'll play around with it next week to see how these attachments:
-Are activated.
-Display on Forms and Reports.
-Affect overall database performance.

JeffCoachman
 
 
Comment by harfang
> I wish Microsoft would let me do what I originally wanted to!

Actually, the idea to combine several types of documents in a single report is more Adobe's Acrobat niche, isn't it? But frankly, I can't see a really good solution to what you are trying to do. What if one document needs three pages, and the next is just a logo? Manually combining and laying out the material will always look much better...

Anyway, success with your project!
(°v°)
 
 
20080723-EE-VQP-34 / EE_QW_2_20070628