We help IT Professionals succeed at work.
Get Started

VB Code for Command Button to click on Hyperlink in Table

Last Modified: 2013-11-28
Hello Experts!
I am reconfiguring an Access 2007 database to remove macro commands and use Visual Basic code.  I've been able to do so with all other controls in my Form save one (with the help of your site).  My abilities in Visual Basic are very rudimentary so I need your expertise.  I'm hoping I can explain this in a manner that it makes sense.

I would like to write VB code for a command button in a Form so that when the user clicks on the button, it opens an external PDF unique to each record.  My thoughts were that I should create a hyperlink field in the Table to link to the PDFs folder for each record.  Then to create VB code in the command button's OnClick Event Procedure in the Form that jumps to the Table's hyperlink field of that same record to open each unique PDF.

Here are the variables:
Form Name = F_AR_Entry
Form's Command Button Name: View_Doc1
Table Name = T_DocList
Table's Field Name where Hyperlink to PDF is Stored = View_Doc
Record ID# Used in Attachments: E003
Name of Folder Where PDFs are Stored: 03.12.09 MBJR TEST
PDF File Name: E003.pdf

I'm a beginner - so I don't have any code to add since I don't know where to start w/ this.  I've attached snapshot screens that will hopefully illustrate what I'm trying to do.

I appreciate your help!
Watch Question
Planning & Analytics Manager
This problem has been solved!
Unlock 2 Answers and 7 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE