Bookmark when converting to pdf (1 Viewer)

Sac

Member
Local time
Yesterday, 20:11
Joined
Feb 28, 2020
Messages
48
Hello,

I have a form that displays a record list from a query. I want to add a bookmark to the unique Id of each record from the query. The Id is a string name that is store in a table field. I tried to use the form's text field to be a link. But when I convert to PDF the link does not work. I also tried to make a hyperlink field in the table and it did not work either when converting to pdf. I use Acrobat 9 pro. And I made sure to check the checkbox in preference the create links from Urls option (As I also try to use urls as a test to see if the link would work when converting to pdf but it did not work eitherr).

Basically the list will have the Ids as bookmark that when click, it would redirect to the details of that record further down the document.
The list would be appended at the start of a report.

Any help will be appreciated.

Attached is a picture of the query list result.

Thanks guys
 

Attachments

  • Defect_List.jpg
    Defect_List.jpg
    104.5 KB · Views: 113

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:11
Joined
May 7, 2009
Messages
19,169
I also tried to make a hyperlink field in the table and it did not work either when converting to pdf.
I am not sure if it will "hyperlink" back to your table.
but i have tried using hyperlink to a website or page, it does go to the page on the website when converted to pdf (using DoCmd.Output).
 

Sac

Member
Local time
Yesterday, 20:11
Joined
Feb 28, 2020
Messages
48
Arnelgp,

Thank you for your response!

I cannot even get the url to work using DoCmd.Output How did you get the link to work in PDF. Also what version of PDF are you using?
I use the form text field and set it to be a hyperlink in the properties. and put a website as target.



Thanks for you help!

Sac
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:11
Joined
Feb 19, 2002
Messages
42,981
Bookmarks cannot be used this way. Each time a recordset is open, the bookmarks change. So, the bookmark for cust 123 now will always be different from the bookmark, the next time the form is opened and moves to cust 123. That's why when you want to requery a form (which reruns the RecordSource query) and you want to reposition to the record you were previously on, you can't do it with a bookmark. You have to do it by saving the PK of the record you want to reposition to and searching for it.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:11
Joined
May 7, 2009
Messages
19,169
this is the sample report i made using Output to.
 

Attachments

  • TABLE1.zip
    38.9 KB · Views: 118

Sac

Member
Local time
Yesterday, 20:11
Joined
Feb 28, 2020
Messages
48
Bookmarks cannot be used this way. Each time a recordset is open, the bookmarks change. So, the bookmark for cust 123 now will always be different from the bookmark, the next time the form is opened and moves to cust 123. That's why when you want to requery a form (which reruns the RecordSource query) and you want to reposition to the record you were previously on, you can't do it with a bookmark. You have to do it by saving the PK of the record you want to reposition to and searching for it.
Thanks Pat!
 

Sac

Member
Local time
Yesterday, 20:11
Joined
Feb 28, 2020
Messages
48
Arnelgp,

I got the hyperlink to work. I Used the DoCmd.Output in a buttom click event in the form. But I also had to do something like this by adding a text field in the form. I put in the properties Hyperlink: yes and Display As Hyperlink: to If Hyperlink

IIf([SEGMENTID-path]<>"",[SEGMENTID] & ".jpg" & "#" & [SEGMENTID] & "#","").

I could also do export to Pdf from the menu.

The only issue is that I can display the Segment ID info sheet in a separate file. from the above link eg:

C\:SAN2.pdf

I have sheets for each inspection identify by the segment unique ID. So from summary you can now click in the ID and the file of that inspection will pop up. Not Ideal but will do for now. I wanted to displace Just SAN1 or SAN2 in the link as bookmark.

Cheers,

Sac
 

Attachments

  • SUMMARY.jpg
    SUMMARY.jpg
    108 KB · Views: 103
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:11
Joined
Feb 19, 2002
Messages
42,981
A bookmark is not a hyperlink. I took your question too literally:)
 

Sac

Member
Local time
Yesterday, 20:11
Joined
Feb 28, 2020
Messages
48
A bookmark is not a hyperlink. I took your question too literally:)
Pat,

Tank you fro your response. I am sorry. My intention is to pass plain text (a string ID like SAN1) into the hyperlink so when I click it, it can find the first occurrence of that string ID within the pdf document. Right now, I am able to pass the string but with its path location of the computer. I just want the ID only.
I don't know any other way how I can do this when I convert the form to PDF.

I am sorry for the confusion.

Sac
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:11
Joined
Feb 19, 2002
Messages
42,981
I only suggest this because you are having trouble getting the hyperlink to work correctly. I have never tried what I am suggesting although I have run Access in "batch" mode and opened a specific macro, NOT AutoExec.

Create a macro that opens the form using the where argument. Populate the Where argument with the argument (ie record primary key) you pass as an argument to Access. Since I find macro logic bizarre, I tend to have the macro open a function where I can write VBA which makes infinitely more sense to me.

You'll need to look up the syntax. But not only can you open Access by specifying a macro but you can also pass a value to that macro. That is the string you need to create. Look at the Access tab.

Command-line switches for Microsoft Office products

The command you will use as the hyperlink will look something like:

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" D:\Work\myDb.accdb /x macroname /cmd 12345

Be careful with this because if there are spaces or special characters in your file path, you probably need to enclose the path and name of the database in quotes also.
 
Last edited:

Sac

Member
Local time
Yesterday, 20:11
Joined
Feb 28, 2020
Messages
48
I only suggest this because you are having trouble getting the hyperlink to work correctly. I have never tried what I am suggesting although I have run Access in "batch" mode and opened a specific macro, NOT AutoExec.

Create a macro that opens the form using the where argument. Populate the Where argument with the argument (ie record primary key) you pass as an argument to Access. Since I find macro logic bizarre, I tend to have the macro open a function where I can write VBA which makes infinitely more sense to me.

You'll need to look up the syntax. But not only can you open Access by specifying a macro but you can also pass a value to that macro. That is the string you need to create. Look at the Access tab.

Command-line switches for Microsoft Office products

The command you will use as the hyperlink will look something like:

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" D:\Work\myDb.accdb /x macroname /cmd 12345

Be careful with this because if there are spaces or special characters in your file path, you probably need to enclose the path and name of the database in quotes either.
Thanks Pat!!

I will give it a try.

Sac
 

Users who are viewing this thread

Top Bottom