Question Family tree (1 Viewer)

nobby

Nobby
Local time
Today, 02:53
Joined
Dec 28, 2008
Messages
24
Hi
I am trying to do a family tree database which is going fine so far

I want to be able to distribute this program and supply the run time program for those who don't have Access, So, I need to embed pictures ( Rather than hyperlink) which I have in PDF files
I was trying to drop an active X PDF viewer into a form but I kept getting ole error not registered so given up on that idea.
So, I dragged and dropped a PDF file on to a form and I would like some code to open it when I double click it. As its being redistributed I CANT have links to adobe reader as I don't know if the recipient will have the same location for adobe reader as me

Any ideas
Many Thanks

Rob
 

Frothingslosh

Premier Pale Stale Ale
Local time
Yesterday, 21:53
Joined
Oct 17, 2012
Messages
3,276
Personally, I'd set the program up to be installed into its own directory somewhere, which would also allow you to install required image files. That, in turn, would allow you to link the images rather than embed them, which will go a long way toward minimizing the application's size. Never forget about the 2 GB size limitation on Access databases; images are one of the fastest ways possible to crash into that limit.
 

essaytee

Need a good one-liner.
Local time
Today, 11:53
Joined
Oct 20, 2008
Messages
512
Hi
I am trying to do a family tree database which is going fine so far

I want to be able to distribute this program and supply the run time program for those who don't have Access, So, I need to embed pictures ( Rather than hyperlink) which I have in PDF files
I was trying to drop an active X PDF viewer into a form but I kept getting ole error not registered so given up on that idea.
So, I dragged and dropped a PDF file on to a form and I would like some code to open it when I double click it. As its being redistributed I CANT have links to adobe reader as I don't know if the recipient will have the same location for adobe reader as me

Any ideas
Many Thanks

Rob

How do you know your users will have Adobe Reader? Yes, I know it's a freebie, but the question is still valid.

I know this doesn't answer your question directly but have you considered storing your images/files in a predesigned folder structure relative to the backend data file. When installing your database, you actually create a folder where the backend data file is and sub-folders relevant to your images/files. The images/files can be opened by the user's default system programs.
 

nobby

Nobby
Local time
Today, 02:53
Joined
Dec 28, 2008
Messages
24
Brilliant, So can I put the access database in say C:\family Tree and the images in C:\family Tree\images and then hyperlink to C:\family Tree\images ?
 

Minty

AWF VIP
Local time
Today, 02:53
Joined
Jul 26, 2013
Messages
10,366
I would use the local path as in

strMyFilePath = CurrentProject.Path & "\Images"

This ensures that no matter where it's installed the path is relative.
 

Frothingslosh

Premier Pale Stale Ale
Local time
Yesterday, 21:53
Joined
Oct 17, 2012
Messages
3,276
Yeah, might be best to use VBA to set the location properties for your images when the form is loaded so that people can install it wherever they want. That won't noticeably slow down your form loads, so it should be fine.
 

nobby

Nobby
Local time
Today, 02:53
Joined
Dec 28, 2008
Messages
24
Hi And Thanks essaytee, minty and Frothingslosh
Point snoted for all

Where would I put strMyFilePath = CurrentProject.Path & "\Images"

thanks
 

essaytee

Need a good one-liner.
Local time
Today, 11:53
Joined
Oct 20, 2008
Messages
512
Hi And Thanks essaytee, minty and Frothingslosh
Point snoted for all

Where would I put strMyFilePath = CurrentProject.Path & "\Images"

thanks

Where you would have had your hyperlink field, that is now a normal text field that contains the relative path and filename of your external file. Do not include the absolute path (you can, but then you are restricted or hampered if changes to folder structure are made).

Now when wanting to run an external program to open the file, that is where you prepend CurrentProject.Path to your relative path.

Unless things have changed in the last few years, you will need to declare an API and create a function. Using this function, passing in the image file or pdf or whatever, the function will open the file by using the system default program. I haven't got my code handy at the moment but can post a little later. In the meantime this Stackoverflow thread explains things (go to answer 3).

Edit/Update: A potential gotcha, you may have to account for 32/64 bit operating systems. At present all my apps work under the 32 bit system.
 
Last edited:

Users who are viewing this thread

Top Bottom