locked
Access Report with a hyperlink field that shows as "Error! Hyperlink reference not valid" when the report is exported as an .rtf file and viewed in Word. RRS feed

  • Question

  • I have a Report that shows a field called Ref as a hyperlink.

    The hyperlink can be clicked to open a form for the record with that Ref.

    When the report is exported to a .rtf file and viewed in Word, it appears as "Error! Hyperlink reference not valid".

    The report exports successfully as a .xls, .pdf, or .html file and shows the Ref value correctly (although the hyperlink isnt useable).

    I would like the Ref value to be shown in the .rtf file instead of this error, as is the case for the other file formats.

    Is this possible?


    Nath

    Tuesday, May 23, 2017 12:41 PM

Answers

  • Hi NaPazz,

    the issue is that you are using Hyperlink to open Form with particular record.

    which can work correctly when you try to follow Hyperlink with in Access Application.

    but when you export your report to any other file format then the hyperlink get broken.

    so in other applications Hyperlink not work and in RTF format it displays the error.

    simple solution is to do not use the hyperlink and instead of that you can use DoCmd.OpenForm Method to open form with particular record.

    show your data in Textboxes and at the place of Hyperlink you can use Label that display text.

    so when you click on Label it will open form with particular record. you can use Click event of Label.

    when you export it to any other file format, it will display the Label with text and not display any error.

    Example:

    Private Sub cmdFilter_Click()
        DoCmd.OpenForm "frmMainEmployees", , , "DepartmentID=" & cboDept.Value
    End Sub

    Reference:

    DoCmd.OpenForm Method (Access)

    Output:

    RTF File

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, May 24, 2017 7:11 AM

All replies

  • Hi NaPazz,

    the issue is that you are using Hyperlink to open Form with particular record.

    which can work correctly when you try to follow Hyperlink with in Access Application.

    but when you export your report to any other file format then the hyperlink get broken.

    so in other applications Hyperlink not work and in RTF format it displays the error.

    simple solution is to do not use the hyperlink and instead of that you can use DoCmd.OpenForm Method to open form with particular record.

    show your data in Textboxes and at the place of Hyperlink you can use Label that display text.

    so when you click on Label it will open form with particular record. you can use Click event of Label.

    when you export it to any other file format, it will display the Label with text and not display any error.

    Example:

    Private Sub cmdFilter_Click()
        DoCmd.OpenForm "frmMainEmployees", , , "DepartmentID=" & cboDept.Value
    End Sub

    Reference:

    DoCmd.OpenForm Method (Access)

    Output:

    RTF File

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, May 24, 2017 7:11 AM
  • Thanks very much Deepak.

    I was using the DoCmd.OpenForm method but had the 'Is Hyperlink' property set to yes, unnecessarily.

    Setting 'Is Hyperlink' to No resolved the problem.

    I just had to set the 'Font Underline' property to Yes, and 'Font Color' to dark blue to have the same effect.

    Nath 


    Nath

    Wednesday, May 24, 2017 8:44 AM