Cmd Button to Open hyperlink from table of links

G

Guest

I queried the user groups and found beaucoup ways to open a single hyperlink,
something that I'm pretty sure I already knew. But to open a specific
hyperlink from a table of hyperlinks was not found. Here's the scenario.

I have a database that tracks compliance with contracts / agreements. The
database has over three hundred companies that hold over four hundred
agreements. Each company may have one or multiple agreements.

The companies are stored in the table "Companies" and the agreements in the
table "Agreements". (Now that's an original naming convention.) The two
tables are linked so that when the forms based on these tables is opened,
each company only opens those agreements for which an agreement exists. So if
Company A has four agreements, 1 thru 4, then the main form opens with
Company A and the agreements subform opens with Agreement 1. There are
navigation buttons to navigate to the subforms for the other three
agreements. (there's also a subform in the Agreements subform that tracks the
annual performance).

What I want to do is show on the Agreements subform a hyperlink to the URL
that has the PDF agreement. So on the Company A Agreement 1 subform the
hyperlink would be www.sampleserver.com/agreement1.pdf. On the Company A
Agreement 2 subform, the URL would be www.sampleserver.com/agreement2.pdf.

My first thought was to have a text box bound to a table with all of the
agreement's hyperlinks with a Cmd Button on the Agreements subform calling
the specific file. Would this be the cleanest method? Or would it be better
to just add the hyperlink to each subform and make it "live"?

Thank you.
 
G

Guest

I think that would work okay. Just use the FollowHyperlink method:
Application.FollowHyperlink Me.txtLink
 
G

Guest

Addendum: As I was pulling the links into an Excel spreadsheet (easier to
store until I modify the database) I realised that some of the agreements may
have multiple documents. As an example, Agreement 2 may have an agreement
PDF, an amendment PDF and a termination PDF.
 
G

Guest

Sounds like some table definition mods to me. I think maybe you need anothe
table that actually has the links to all the documents. It would be:
Company_ID
Agreement_ID
Doc_ID
Doc_Name
Doc_Link

This will require some rework on your part, but I think you would be happier
in the long run.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top