PDA

View Full Version : Advice on how to add supporting materials and hyperlinks to database



nathan2314
12-16-2008, 08:03 AM
Hey Good morning everyone, :hi::hi:
I need some advice on the best way to add supporting documents and hyperlinks to my database. Here is the way things are set up as of now.
I have a Main table with unique individuals with primary key = Person_ID. So this main table is now linked to several other subtables by person_ID. Some of these subtables are things like PersonAffiliations, SpouseAffiliations, FinancialInformation, PastHistory, OverseasExperience, TraitsNAbilities, FamilyMembers etc ... each with a primary key of its own and a foreign key of Person_ID. So now I also have a supporting materials table that has its own primary key (SupportingMaterials_ID) but has foreign keys for the main table AND all the subtables (ie person_ID, PersonAffiliations_ID, SpouseAffililiations_ID, FinancialInformation_ID, PastHistory_ID etc....). The SupportingMaterials table has two fields that hold the supporting materials. One is a OLE data type where the user can upload anykind of document, bmp, pdf, jpeg etc... and the second is a hyperlink field where the user can input a hyperlink.
Ok so now I'm kinda stuck on how to implement this set up on my current forms. I have a main form with the information on the MAIN Table at the top with the lower part of the form with a 'tab' control that has all the subtables (PersonAffiliations, SpouseAffiliations,FinancialInformation, PastHistory etc..) as subforms.
So the question is how do I have the options of allowing the user to upload supporting materials (documents, hyperlinks...) for each of the subforms/mainform?? I abit unclear since for each subform I would have to link the Primarykey in the subform to the foreign key in the supportingmaterials table for each subform/table I guess and have a button to click that would allow the user to upload? But what about the case when one document could be a supporting material for more than one subtable (ie overseasExperience and financial information etc...) Not sure of what the best approach here would be.
Appreciate any advice!! :)

OBP
12-16-2008, 09:38 AM
I would create a Document table which has the Full Path to the various Documents.
However to actually open the Documents you can use FollowHyperlink but it doesn't usually work for .PDF documents, you will need to use something like this

If Me.Document_Type = ".pdf" Then
Me.Document_Link.Class = "Package" ' Set class name.
Me.Document_Link.OLETypeAllowed = acOLELinked
Me.Document_Link.SourceDoc = Me![Document Location]
Me.Document_Link.Action = acOLECreateLink
Me.Document_Link.SizeMode = acOLESizeZoom
With Me.Document_Link
.Action = acOLEActivate
.Verb = acOLEVerbOpen
End With

nathan2314
12-16-2008, 10:41 AM
Ok Thanks for the input! :)
What would be that best way to set up the tableform structure so could have the user update links/documents...
This database will end up being on a classified system so sometimes it would be necessary to upload certain documents and sometimes hyperlinks will work.
I'm just kinda stuck on how to set up the forms/tables the best way to allow the user to input the supporting materials. Maybe I should just put a hyperlink and OLE data type fields on each of the subtables and then put those fields on each subform as a subsubform??
I guess users could end up uploading the same document at times for different people thus duplicating and increasing the size of the overall database but I'm not sure how to get around that...??

OBP
12-16-2008, 11:04 AM
I would have a Sub Table with a DocID, Autonumber, a PersonID Number type Integer Long, a Text box called DocPath which holds the Full Path to the Document. Finally a Text field called something like Wherefrom which holds the name of the Form or Subform which generated the Document. This would be autopopulated with the name of the Form which the Subform would be on.
The Subform can be on those Forms/Subforms that require it and I would add a Command button so that the users can browse to and select the name of the Document.
Don't Upload Documents in to the database, it will grow at an enormous rate if you do.
I would have another button that would actually Open the Seelcted document.

CreganTur
12-16-2008, 12:10 PM
This may be slightly off topic, but you can control what is shown in the hyperlink field. Say you want to make things easy on your users and display just the name of the file instead of the full hyperlink- you can do this by giving the hyperlink a title.

Hyperlinks in Access tables are actually made up of multiple parameters, but the first 2 are the most important: Title and Address; they are separated by a pound sign (#). So if you put this into the Hyperlink field:
My File#C:\beir & Pizza\personal files\myfile.txt

then you will see "My File" in the hyperlink field as a clickable link.

Food for thought:gapple: