HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Link to pdf file on server
Post new topic   Reply to topic    HTML Help Forum Index -> Others
View previous topic :: View next topic  
Author Message
hisaw



Joined: 01 Apr 2008
Posts: 2

PostPosted: Tue Apr 01, 2008 11:24 am     Link to pdf file on server Reply with quote

Hi,

I'm new to html and am not sure if this will work, but here's what I am trying to do. In my Access database, I have a form that lists all our literature. There is a button next to each entry labeled "pdf" so that when user clicks it, it will open a pdf file to view that specific piece of literature.
Because all users don't have a copy of Access (that's another story), as a quick fix (until I can get a company web page set up) I have copied this form as an Access Data Page for intranet use. The problem I have run into is that it uses html code and I'm more familiar with VB.
What I want to happen on this form is the literature name that is listed in field "Item Name" for particular record to open that related pdf. I can target the link to open folder that contains all pdf's, but not open the specific file listed in "item name". I need a "where" clause. Is this possible?
I've listed the code I use in VB on the regular database form in case this is not clear.
Private Sub Command21_Click()
Dim strPath As String

strPath = "\\dell4\databases\PDF\" & Me.[ITEM NUMBER] & ".pdf"
If Dir(strPath) = "" Then
MsgBox "There is no pdf for this brochure."
Else
Application.FollowHyperlink strPath
End If

End Sub
Thanks in advance for any help. I've been searching for days trying to find a solution and am not sure it's even possible.
Hisaw
quartzy



Joined: 26 Dec 2007
Posts: 400

PostPosted: Fri Apr 04, 2008 12:48 pm     re Reply with quote

I think what you need is for the html to reference the file name. With a path name. As far as I know this works online but I am not sure what you need to do.
kanenas



Joined: 14 Dec 2004
Posts: 191

PostPosted: Tue Apr 29, 2008 1:17 pm     Use 'href' attribute. Reply with quote

I'm no Access guru, and you probably already resolved this one, but...

Short description: If the page is statically generated, edit the HTML file and set the href attribute of each A element to the URL of the relevant PDF.

For example:
Code:
<a href="file:///dell4/databases/PDF/5.pdf">Visit Finland</a>

Note the use of backslashes rather than forward slashes. If the page is dynamically generated (using e.g. ASP), you'll need to alter the server-side script in order to set the href attribute; the exact way of doing this depends on the script, but you should be able to use your knowledge of VB to figure out where the link is being generated, then set the href property to the URL. It'd probably look something like:
Code:
link.href= "file:///dell4/databases/PDF/" & Me.[ITEM NUMBER] & ".pdf"

I'm just guessing that the record is stored in 'Me'.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> Others All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial