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 
Access and Adobe
Colin Eastaugh 
     
5 months ago
I was hoping to use Access's Recordsets and FollowHyperlink to open in Adobe pdf files contained within a folder, I often need up to 10 pdf files open at anyone time.  Can be done manually but it is a pain.

Simple VBA code

Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset(SQL)
While Not rs.EOF
FollowHyperlink Link
rs.MoveNext
Wend
rs.Close
Set rs = Nothing

Example of a Link field within a record = C:\Users\Colin\OneDrive\Documents\Accounts\ABDPFY14.pdf

Running the RecordSet I only seem to get one PDF open even though I have selected many more.  I have used to statusbox and the programme is running correctly, it is looping.  I have put in a timer so that the loop was running slower, and that didn't work.  Bemused, and a tad frustrated.

Does anyone have any suggestions why Access and Adobe don't appear to be working harmony.
John Davy  @Reply  
         
5 months ago
Hi Colin, For what it is worth, I used an image box and an photopath field on the form to test. I don't have Adobe. Here is your VBA slightly modified. It may not be helpful but here is my vba: John  Private Sub TestBtn_Click()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("CustomerT")
While Not rs.EOF
If Not IsNull(rs!PhotoPath) Then
FollowHyperlink rs!PhotoPath
End If
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
End Sub
John Davy  @Reply  
         
5 months ago
It displayed all the images.  John
Richard Rost  @Reply  
          
5 months ago
Colin yeah, it looks like you're not referencing a field in your recordset. Maybe it's rs!Link

Also... if that doesn't work, try the Shell command. This also happens to be covered in today's TechHelp video: Security Warning
Colin Eastaugh OP  @Reply  
     
5 months ago
John and Richard, many thanks for your comments, I will roll up my sleeves and have another go today or tomorrow.

Seasons greetings.
Colin Eastaugh OP  @Reply  
     
5 months ago
Well I rolled up my sleeves, or rather I sat down to have a look at the problem again, and you were both spot on, I wasn't referencing a field in my recordset, stupid error, but an error nonetheless that I didn't spot over several hours of shouting at the screen.  

Many many thanks for pointing out the problem, a wonderful early Christmas present, I can now open loads of PDF files to my heart content.

What a great resource the forums are.
Richard Rost  @Reply  
          
5 months ago
Glad to help. Even with stuff I build, it's usually the simple things that you overlook that cause most of the problem. Today I pulled my hair out for an hour and it turned out I was missing a comma in one of my SQL statements.
Joe Holland  @Reply  
      
5 months ago
So it's not just me? Glad to hear others struggle sometimes with the simple things. Just think if we could capture images of coders yelling at their screens and set that to music.
Richard Rost  @Reply  
          
5 months ago
Joe like one of those Fail videos where people fall down or wipe out on skateboards / bicycles / etc. LOL
Joe Holland  @Reply  
      
5 months ago
LOL.

My brain sees things as a logical process already so most of my "pull-your-hair-out" moments come from syntax issues. Luckily, all I have to do is search your site and magically the answer appears!
Richard Rost  @Reply  
          
5 months ago
And if it doesn't... you know what to do! :)

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

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: 5/2/2026 8:23:04 AM. PLT: 0s