Results 1 to 4 of 4
  1. #1
    PaulMoor is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    6

    Text field custom formatting

    Dear friends, I have the following task: to store long hyperlinks in database.
    As I understood the most suitable way to do it - is to use Text Filed in database table. The problem is that link contains lot's of symbols and I wish to format the display of the link.

    For example:

    The link is: I:\ENEA\RUMO, Moscow\PH\Projects\DRA\Regulatory approved documents\Azarga\01_MA\2017-04-18 Azarga MA.pdf
    But I wish to display the link for users something like this as text: Link to file (and Call the Application.FollowHyperlink method)



    I supposed to use custom formatting for Text Filed in the following manner:

    "Link to file";"Link not available"

    But this approach does not change the displayed text of the link. Who can provide advice on how to format the display of the link?

  2. #2
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    604
    Does each link get it's own display text or do you just need a button that says 'Link to file'? The control source of your text box can be static text like 'Link to file' or it could be another field in your table, say something like a field called [DisplayText]. The text box has a display as hyperlink property you can use even if the actual text in the textbox isn't a hyperlink. Then on the OnClick event of the textbox the code would simply be
    Code:
    If Not IsNull(Me![HyperlinkField]) Then Application.FollowHyperlink Me![HyperlinkField]
    or what ever the name of your field is.

  3. #3
    PaulMoor is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    6
    Quote Originally Posted by kd2017 View Post
    Does each link get it's own display text or do you just need a button that says 'Link to file'? The control source of your text box can be static text like 'Link to file' or it could be another field in your table, say something like a field called [DisplayText]. The text box has a display as hyperlink property you can use even if the actual text in the textbox isn't a hyperlink. Then on the OnClick event of the textbox the code would simply be
    Code:
    If Not IsNull(Me![HyperlinkField]) Then Application.FollowHyperlink Me![HyperlinkField]
    or what ever the name of your field is.
    1. The display text of all links should be the same. For example: Link to file.
    2. Is it possible to change the displayed text at a table level?

  4. #4
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    604
    In that case just make the control source of the text box
    ="Link to file"
    And put your hyperlink code in as posted above. Or better yet make a command button?

    You shouldn't need to make any changes at the table level. You don't want your users to have any access directly with the tables anyway. All interaction should be done through forms and reports.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-19-2019, 06:13 AM
  2. Replies: 6
    Last Post: 10-02-2018, 09:57 AM
  3. Replies: 5
    Last Post: 05-22-2017, 01:34 PM
  4. Replies: 5
    Last Post: 10-03-2014, 11:19 AM
  5. Hyperlink Field Custom Formatting?
    By excellenthelp in forum Access
    Replies: 1
    Last Post: 08-12-2014, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums