Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-12-2019, 12:17 PM   #16
June7
Newly Registered User
 
June7's Avatar
 
Join Date: Mar 2014
Posts: 1,107
Thanks: 0
Thanked 260 Times in 260 Posts
June7 will become famous soon enough
Re: View a PDF from Access

The VBA should work. If you want to provide db for analysis, follow instructions at bottom of my post.

@pbaldy, use code tags or on the Advanced editor window, uncheck "Automatically parse links in text". Has to be done every time a post is created or edited.

__________________
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
June7 is online now   Reply With Quote
Old 01-12-2019, 12:18 PM   #17
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,362
Thanks: 10
Thanked 3,927 Times in 3,867 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: View a PDF from Access

Quote:
Originally Posted by Dangerous View Post
I have no idea how to find that out.
I mean post the updated code from your first post.
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 01-12-2019, 12:19 PM   #18
Dangerous
Newly Registered User
 
Join Date: Oct 2018
Posts: 71
Thanks: 15
Thanked 0 Times in 0 Posts
Dangerous is on a distinguished road
Re: View a PDF from Access

Quote:
Originally Posted by Dangerous View Post
I have no idea how to find that out.
It reads D:\MDF Database\Images\strPDFfile

Dangerous is offline   Reply With Quote
Old 01-12-2019, 12:21 PM   #19
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,362
Thanks: 10
Thanked 3,927 Times in 3,867 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: View a PDF from Access

You have to concatenate the fixed path and the variable. See my updated code in post 2.
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 01-12-2019, 12:22 PM   #20
Dangerous
Newly Registered User
 
Join Date: Oct 2018
Posts: 71
Thanks: 15
Thanked 0 Times in 0 Posts
Dangerous is on a distinguished road
Re: View a PDF from Access

Quote:
Originally Posted by pbaldy View Post
I mean post the updated code from your first post.
Got you now.

Private Sub Label1689_Click()

Dim strPDFfile As String
strPDFfile = "D:\MDF Database\Images" & "strPDFfile"

Application.FollowHyperlink "d:\MDF Database\Images\FileName.pdf"

End Sub
Dangerous is offline   Reply With Quote
Old 01-12-2019, 12:25 PM   #21
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,362
Thanks: 10
Thanked 3,927 Times in 3,867 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: View a PDF from Access

Now you have the path twice. Try the line in post 2 after putting just the file name in the variable.
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
The Following User Says Thank You to pbaldy For This Useful Post:
Dangerous (01-12-2019)
Old 01-12-2019, 12:30 PM   #22
Dangerous
Newly Registered User
 
Join Date: Oct 2018
Posts: 71
Thanks: 15
Thanked 0 Times in 0 Posts
Dangerous is on a distinguished road
Re: View a PDF from Access

Yeah realised that but it still didn't work till I change it to

Private Sub Label1689_Click()

Dim strPDFfile As String
strPDFfile = "D:\MDF Database\Images" & PDFfile

Application.FollowHyperlink strPDFfile


End Sub


PDFfile (controlname) instead of strPDFfile.

Works fine now.

Dangerous is offline   Reply With Quote
Old 01-12-2019, 12:32 PM   #23
Dangerous
Newly Registered User
 
Join Date: Oct 2018
Posts: 71
Thanks: 15
Thanked 0 Times in 0 Posts
Dangerous is on a distinguished road
Re: View a PDF from Access

Thanks for all the help everyone.
Dangerous is offline   Reply With Quote
Old 01-12-2019, 12:36 PM   #24
Dangerous
Newly Registered User
 
Join Date: Oct 2018
Posts: 71
Thanks: 15
Thanked 0 Times in 0 Posts
Dangerous is on a distinguished road
Re: View a PDF from Access

I spotted the errors by adding a hyperlink field and assigning the strPDFfile variable to it. I then saw what was happening and corrected the errors.

I'm learning, slowly but learning. Thanks again.
Dangerous is offline   Reply With Quote
Old 01-12-2019, 01:34 PM   #25
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,362
Thanks: 10
Thanked 3,927 Times in 3,867 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: View a PDF from Access

Glad you got it working.
__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 01-12-2019, 02:33 PM   #26
Dangerous
Newly Registered User
 
Join Date: Oct 2018
Posts: 71
Thanks: 15
Thanked 0 Times in 0 Posts
Dangerous is on a distinguished road
Re: View a PDF from Access

Quote:
Originally Posted by pbaldy View Post
Glad you got it working.
Wouldn't have without your help. Thanks and thanks for the input from everyone else.
Dangerous is offline   Reply With Quote
Old 01-12-2019, 02:39 PM   #27
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 32,362
Thanks: 10
Thanked 3,927 Times in 3,867 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: View a PDF from Access

Happy to help!

__________________
Paul
Microsoft Access MVP

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to view object properties in form design view (Access 2010) Groundrush Forms 3 05-16-2014 05:54 AM
SQL linked to Oracle view - to pass view over to Access Client Rx_ SQL Server 3 04-10-2013 08:40 AM
Why can't I click down in the view menu to view a form in datasheet view? Velcrocateb Forms 2 09-05-2012 01:11 PM
In access 2007 convert from form view to design view fllopez65 Introduce Yourself 5 09-22-2011 07:39 PM
Zoom in sql view / design view access 2007? sean99 General 3 09-05-2008 07:25 PM




All times are GMT -8. The time now is 09:01 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World