Link to home
Start Free TrialLog in
Avatar of kirk0820
kirk0820

asked on

"OLE Object" in "Bound Object Frame" when Set to Zoom or Clip on a Form Causes Font to Display Very Small / Tiny Intermittently

I have an Access 2000 database which consists of a datatable with several hundred records.  Then I have a form which displays the records from the datatable with some nice borders and stuff.  The database has three fields: "serial number," "name," and "PDF file."  I only just recently added the "PDF file" field to the database.  It is set as an OLE object in the datatable.  And it is pulled onto the form as a "bound object frame."

My problem is, whenever I'm looking at the records (or a subset of the records) from the form, if there are embeded PDF files in any of the records showing on the rows, and I click on refresh, then the font on the records drops down to teeny-winy.  After much experimentation, it turns out that this is intimately connected with the OLE object.  I've set the format of the OLE object being pulled to the form to display as and icon.  So I see a miniature Adobe Acrobat icon on that "PDF file" object on the form.  I've set the "size mode" to Zoom (I've also tried Stretch).  Whatever size that Access needs to zoom the icon down to make it fit in the control on the form, is what size the the font is on the rest of the records (intermittently).

I can consistently cause this behavior by clicking on RECORDS > REFRESH.  The behavior goes away if there are no records showing on the form with PDF files embeded.  The problem goes away if I hide the PDF file control on the form.  The problem goes away if I set the "size mode" on the control to CLIP (both ZOOM and STRETCH) cause this misbehavior.

Anyone ever run accross this?  Anyone know how I can get around this?  Please no visual basic coding because I am totally illiterate in that.

Thanx in advance.
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Hello kirk0820

I did run some tests (Access 2000 SP3), but I was unable to reproduct this behavior. If you look at your table, what does the PDF file field show? "Package"? Also, when you insert the files, do you choose "Link to file"? or "Display as Icon"?

This is really one more to add to the list of "why *not* to use OLE objects in Access". I've never seen a working application using them, save for tiny bitmaps.

You probably should only store the path to the file in your database, but then the interface would require a little VB code to be useable. Not much, perhaps, but still.

Sorry I couldn't help.
(°v°)
Avatar of puppydogbuddy
puppydogbuddy

It depends on the method (out of 3) chosen to store the image and on the method chosen to display the image.  There are tradeoffs to each.

see these links:

http://jamiessoftware.tk/

http://www.ammara.com/articles/accesspictureole.html

http://office.microsoft.com/en-us/assistance/HP052802251033.aspx

http://office.microsoft.com/en-ca/assistance/ha011472041033.aspx

Re:size mode
After you add the image to the form, click the SizeMode property and select one of the following values. Setting Description
Clip Displays the picture at actual size. If the picture is larger than your form window, Access cuts off the image.
Stretch Sizes the picture to fit the form window. This setting may distort the image.
Zoom Maintains the correct proportionality of the image regardless of how you size the from. This setting won't clip the picture or distort its proportions.
As to speccifically what is causing the distortion in your casee, it may be that your objects are not sized properly for your screen resolution.  See this link for a free form resizer with a developers license.

http://jamiessoftware.tk/
Avatar of kirk0820

ASKER

HARFANG:  thanx a meg for testing this out for me (and sorry for the delay in replying).  I actually stumbled across something that seemed to rectify the problem I described.  If I set the bound object frame on the form so that it is "sent to back” (as opposed to “bring to front”), then the problem with the font size intermittently going really tiny goes away.

By the way, I also realized later that if I set the bound object frame (which is pulling and OLE object from the datatable) to a really large size, then the font could intermittently go really huge on the font in the surrounding records.

To answer your questions, the PDF object on the form shows a PDF icon (the same icon as you’d see if you had a PDF file on your desktop) with the words “Acrobat Document” below.  Since the control on the form is small and set to zoom, the PDF icon is very tiny, and the text is below the icon is actually usually cut in half and clipped at the edges.

I am dragging and dropping the PDF files into the records showing on the form.  So I am embedding the files into the database.

I’m really interested in your point about the inadvisability of using OLE with Access.  I see from PuppyDogBuddy’s comments below that there can be lots of pitfalls with this, but these seem to stem from not having the right “server” application on the end user machine.  All of my users have Access 2000 and Adobe Acrobat Reader on their machines.  In your opinion, is there still significant potential for the disconnect to occur with this embedding technique?  More importantly, is there some additional risk with the Access database becoming corrupted that you know of when embedding files into it?  I had the greatest difficulty when I was first building this database a couple years ago with the whole thing becoming corrupted several times.  After much trial, error and experimentation, I ended up making the database an .MDE (compiled?) file to finally resolve the corruption.



PUPPYDOGBUDDY:  thanx so much for the very useful links and information regarding OLE.  It was very helpful and got me to understand a little more about what is going on behind the scenes.  As you know, I’m embedding Acrobat files into the records in my database, not images.  However, after reading through the articles you pointed me to, it almost seems to me as if the two things are very analogous.  Both of them involve “invoking” an external application to handle display of the embedded file object.

Let me ask you the same questions as I did Harfang above?  All of my users have Access 2000 and Adobe Acrobat Reader on their machines.  In your opinion, is there significant potential for the disconnect between Access / Acrobat to occur using this embedding technique?  More importantly, now that I’m embedding files into this database, is there some additional risk with it becoming corrupted that you know of?  I had the greatest difficulty when I was first building this database a couple years ago with the whole thing becoming corrupted several times.  After much trial, error, and experimentation, I ended up making the database an .MDE (compiled?) file to finally resolve the corruption.

Thanx in advance.
kirk0820,

Obviously, if all your users have the same versions of Access and Acrobat Reader installed, you should not encounter as many problems, and perhaps even none at all.

However, I never understood the benefits of using OLE. It has always seemed so much simpler to me to store only the file names and manage a folder with the documents on the side. This reduces the database size, leaves the documents available for other uses, makes it easy to copy, download, e-mail and otherwise access the information.

This requires some programming to get a smooth interface, but nothing really complex.

Using OLE however, you start up with no programming, which sounds awfully good, but as soon as you have the slightest special need, you will need quite heavy programming. Nothing easy about manipulating OLE objects in a table.

The one thing that really stopped me short: drag a file to an OLE control. You can look at it, perhaps edit it, all is well. Now ask Access to save the file to a new location.... CAN'T DO! You actually need to open the server application and use "save as" or the like. I really cannot see the point in embedding a file if Access is not even capable of taking it out again.

Success with your application!

(°v°)
Kirk,
The only thing I can add to Harfang's comment is that there is a third party image control for Access (see the link) that is supposed to overcome most of the OLE limitations mentioned by Harfang.  If you are serious about storing images in an Access database, I would investigate this product further.  They allow you to download a functional evaluation version.  

                              http://www.ammara.com/start/index-aw1.html?campaignid=2959608&adgroupid=456744588&creativeid=1492213578
PUPPYDOGBUDDY:  I looked at the DBPix link you sent me.  It seems to only apply to "images" being stored in an Access database, but not applicable to the Adobe Acrobat files which I'm trying to store.  Also, I get the impression from their web-site that this "add-in" should ideally be installed on every client machine that is using the database?

By the way, I've had a further development with my project.  Wouldn't you know it - as soon as I started testing out this database with other computers, I ran into a couple of problems.  It works very well....except that when I test it out on a machine with the latest Acrobat (7.0) reader installed, I get an error message:  "The operation on the Acrobat Document object failed... the OLE server may not be registered... to register the OLE server, reinstall it."  Or, if they have Acrobat 7 (full), it works fine, except, it tries to force the control on the form in Access to show the contents (as opposed to showing an icon).  But since the database is read-only for these other users, that creates a conflict and they seemingly get stuck.  In reality, there's a message on the status bar which says something to the effect that the record cannot be updated, and hitting escape gets around this.


HARFANG:  I'm being lazy here.  But I tried experimenting by setting my Access database so that the control on the form which stores the PDF would only accept "linked" files.  I right-clicked on the bound object control and went to DATA then OLE TYPE ALLOWED and set it to "Linked" only.  However, when I scan a file and create a PDF on my desktop, then drag that PDF file onto the control on the records in the database, it still embeds the file.  I even tried creating a simple database from scratch and setting the relevant control on the form to allow "linked" only.  However, it still embeds the file by default.  Please bear in mind, I'm endeavoring to make this as simple as possible for the users, because I will have about 5 people who will be maintaining this thing (and many more who will have read access).

But another question, even if I could somehow lock it down so that the form only allowed linked PDF files, then would that have any amelioration on the problems I'm having with some users' Acrobat 7 causing slight misbehavior?

I wasn't quite sure what to make of it when you said you were really stopped short regarding the dragging and dropping of files into Access.  Was that a "bad" thing?

Again, thanx much for all the help provided.
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PUPPYDOG & HARFANG:  Again thanx much for all of the advice you've provided.  And again, sorry for my seeming procrastication on this question.  Actually, I've been working on it but I'm a relative novice, and so it takes me a while to get any kind of a grip on these new approaches.

HARFANG:  I've been trying to work with your suggestion to use controls that are set to "hyperlinks."  It's very promising in a lot of ways, but there are certain "problems" (from my point of view) which I can't seem to overcome (maybe they're insurmountable).

I don't want to wear out my welcome by asking you yet another series of questions along the lines of a hyperlink tutorial.  So if don't get a response back from you in the next day or so, I'll go ahead and assign point and close this question.

Then I'm probably going to submit a brand new question into the ExpertsExchange system.
kirk0820

If you choose to abandon the OLE approach, I will consider this question answered (^v^)

As for hyperlinks, I believe there is nothing that you did with linked OLE objects that you cannot do with hyperlinks, or even simple text fields for that matter. But this discussion is best left for a fresh question.

By creating a new question with an explicit title, you will attract other experts who's attention was not caught by OLE objects, for example. Anyway, this would be in line with the general practice at EE.

Cheers!
(°v°)