Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
On Click Open Local File
David Forney 
    
8 days ago
Sometime back I found a video that showed how to open a word file in a new window with a button on a form. The VBA takes the file name from a text field on the form. I made it work perfectly however somehow, I must have deleted the code and I cannot find the video I used. the following is code I tried
:
Private Sub passengerlistbtn_Click()
FollowHyperlink "passengers"
End Sub

Do I need to do some sort of Dim code?

Dave
David Forney OP  @Reply  
    
8 days ago

Kevin Robertson  @Reply  
          
8 days ago
David Forney OP  @Reply  
    
7 days ago
Thank you! I still got an error saying it could not find the directory. So I moved the access file to the same directory as the files I wanted to open, and it worked fine. Don’t know if it’s possible to specify a directory for the files I want to open without the accdb file in the same directory.
Sam Domino  @Reply  
      
7 days ago
David If the file is not in the same directory as Access, you'll need to give the "FollowHyperlink" function the full path name.  For example, if the file is in your downloads folder....   FollowHyperlink "C:\Downloads\passengers.doc".
Richard Rost  @Reply  
          
7 days ago
And if the files are in a folder under the database folder, you can use:

MyDir = CurrentProject.Path & "\FolderName\" & FieldContainingFilename
Add a Reply Upload an Image
Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/17/2026 11:34:03 AM. PLT: 0s