Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Location
    Kansas City
    Posts
    103

    Unanswered: Conditioning Hyperlink Characteristics

    Can the hyperlink property be contingent upon the string value? I have searched this forum but can't find an answer or any coding ideas.

    For example, I have a control (text box) in the detail section of a form that's populated by a query/table. For each record, the text box displays a job title, however, some of the stings contain both a title and address to a PDF file containing a job description. Ideally, I'd like the text box to possess the characteristics of a hyperlink (format/handpoint) and function as a hyperlink for those records containing a valid hyperlink, and appear as normal text for those records with only a job title but no description to follow.

    Obviously, setting IsHyperlink to Yes on the form's property sheet is "all" or "nothing", so I was trying to apply some conditional logic to effect the characteristics of the text box when the form is loaded. To make things easier, I also have a field in my query/table with the value true/false, indicating whether the text box is a valid hyperlink or not.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    This really begs the question:
    WHY do you have strings that contain two very separate pieces of data combined as one?
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2002
    Location
    Kansas City
    Posts
    103
    The text box needs to display job titles, regardless of whether a pdf file exists with a job description. Space on the form is at a premium, so I didn't have room for a redundant control.

  4. #4
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    ...if the form needs to have a text box with two very different things, and space is so tight, what would two text boxes one with the title the other with your hyperlink differ, other than making your life easier? The space between them would be what, a pixel or two. I don't have the vba background, but I bet you can go
    Code:
    if (Me.YourHyperlinkTxtbx = Null){
       Me.YourHyperlinkTxtbx.Visable = false
       Me.YourTitleTxtbx.Width = SomeValue
       Me.YourTitleTxtbx.Grow = True
    }
    Ryan
    My Blog

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    But if the data was separated you could use the path to the PDF file as the hyperlink! But because they're combined it is far, far harder to do so!

    You don't have to display the UNC path, it just hides behind the scenes behind the job title control.
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •