Discussion Locked

Correct hyperlinks-Access 97 reports

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to output a report from Access 97 to create a web page that includes hyperlinks. Every method I've tried results in hyperlinks that are not correct. Ideally, I'd like the hyperlink to display certain text, but link to another web page. If I export to HTML, the web page is created as a table, which I don't want. I can output to RTF format, then copy from Word 97 to Front Page 2000. However, the hyperlinks are not correct. Typically, a hyperlink that started as file1.html becomes http//file1.html. If I have the full address in the database, it still gets screwed up by the time it gets to Front Page. I'm trying to create a static web page, but be able to easily re-create it from the database when changes occur.
If you want to see the resulting web page I'm trying to create (but without the links), look at my web site:
http://www.dtrmusic.com
Click on "CDs by Composer". The CD numbers should link to each page about the specific CD.

3 replies

by peyison

You might try creating the HTML yourself in code. Something like:

Sub MakeHTML()
Dim db as database
Dim rst as recordset
Dim sSql as String
Dim iFile as Integer
Dim sText as String

iFile=FreeFile
Open "CDByComp.htm" for Output as iFile
'--write out the HTML at the top of the page
Print# iFile, ""
Print# iFile, ""
Print# iFile, ""
Print# iFile, ""
Print# iFile, ""
Print# iFile, "DTR CDs by Composer"
Print# iFile, ""
Print# iFile, ""
Print# iFile, "
Print# iFile, "

DTR CDs by Composer

"
Print# iFile, ""

'--select the records to appear in the HTML
sSql = "Select CDNumber, CDName, Composer From tblCDs Order By Composer"
set db=DBEngine(0)(0)
set rst=db.openrecordset(sSql)

Do until rst.eof

'--loop through all records and create the HTML
Print# iFile "

"
Print# iFile rst!CDName "[" & rst!Composer & "]"
Print# iFile "" & rst.CDNumber & "

"
Loop

Print# iFile
Print# iFile

Close# iFile

rst.close
set rst = nothing
set db = nothing

End Sub

This has not been tested, but should give an idea.

Hope this helps.

by bob sellman

Worked great with just some tweaking
of the code (including, for anyone who
uses it, adding rst.MoveNext within the
loop). Thanks a lot.
Any suggestions for displaying images on
reports (see my other question) where a
field in the database has the image
filename (jpg/pcx/gif, etc.)?

This discussion is closed to new replies.