Results 1 to 9 of 9
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Hyperlink default value (2002 SP-2)

    In my Order Detail form I have a Hyperlink to a .pdf image of the delivery documents (stored on external hard drive).
    Sample Path: F:PODImages30501.pdf
    The default value of the box is "F:PODImages
    The numeric value is from txtProNo on the same form. For the link to work, I must type the numeric value into the hyperlink along with the required ".pdf". This has resulted in a number of typo errors (ie. .pfd, or number inversion) - which results in a broken link.. Might there be a way to have the default value include txtProNo as well as the ending ".pdf"?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hyperlink default value (2002 SP-2)

    Is the ProNo assigned automatically (for example because it is an AutoNumber field), or is it a value entered by the user?

    Should the user be able to modify the path and name of the .pdf file, or will it ALWAYS be "F:PODImages<txtProNo>.pdf" ?

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink default value (2002 SP-2)

    Sorry for the delay; I didn't get a e-mail notice of your post.

    The ProNo is an AutoNumber assigned upon close of frmOrderNew
    I currently have a cmdbtn to edit the link if necessary:
    '---------------------------------------------------------
    'cmdbtn to edit the POD Hyperlink
    '---------------------------------------------------------
    Private Sub cmdPODedit_Click()
    Me.txtPODImage.SetFocus
    If Not IsNull(Me.txtPODImage) Then
    Me.txtPODImage.SelStart = Len(Me.txtPODImage)
    End If
    End Sub

    EDIT: If the default value works, I suppose there would never be a need for the "edit" cmdbtn. The ProNo would never change.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hyperlink default value (2002 SP-2)

    If the link should ALWAYS be to "F:PODImages<txtProNo>.pdf", you don't need a separate field for it, since it is derived information. Instead, you can put a command button on the form (or a label, if you prefer), that opens the link when clicked:

    Private Sub cmdLink_Click
    Application.FollowHyperlink "F:PODImages" & Me.txtProNo & ".pdf"
    End Sub

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink default value (2002 SP-2)

    Hans,

    That's far too simple! Got anything more convoluted? <img src=/S/clever.gif border=0 alt=clever width=15 height=15>
    Thanks friend! It works perfectly.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink default value (2002 SP-2)

    Hans,

    Doing a little testing here.
    If the image (.pdf) has not been created yet (paperwork not received yet), I get Error '490' with the debug option.
    Can I "handle" that error with say a msg like "Paperwork not yet received"?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hyperlink default value (2002 SP-2)

    Sure, why not?

    Private Sub cmdLink_Click()
    On Error GoTo ErrHandler

    Application.FollowHyperlink "F:PODImages" & Me.txtProNo & ".pdf"
    Exit Sub

    ErrHandler:
    MsgBox "Something went wrong - paperwork not received.", vbInformation
    End Sub

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hyperlink default value (2002 SP-2)

    > Got anything more convoluted?

    Sure, why not? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    See <post#=201988>post 201988</post#>, a reply to a question by a certain bfxtrfcmgr <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  9. #9
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Hyperlink default value (2002 SP-2)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>
    (changing my signature didn't help much did it?)
    Thanks Hans, the ErrHandler works great (except I had to edit the text: "Hey stupid!. . .)
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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