Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pathname when using 'insert hyperlink' (2000)

    Hi,

    Is there any way to make a default pathname when using the "insert hyperlink" command as l would always like to get the files from the same area.
    I would like the file name to be *.* so it does not point to a particular file but all the files in a directory.

    The actual pathname l would like to use would be: PANTHERGenHUMSProgCoordMemSeaKingWHLIncoming*.*

    see attachment.

    Any assistance would be appreciated.

    Justin

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Default pathname when using 'insert hyperlink' (2000)

    I don't know how to get a default path. It seems to me that the default path is the current project path.

    But I don't understand what you achieve be making a hyperlink to all files in a directory "*.*".

    A hyperlink is something that will open a file with a double click. Do you want it to open every file one after the other?
    Regards
    John



  3. #3
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default pathname when using 'insert hyperlink'

    Tne reason l want to use *.* is so that all the files in the path are selected (although not opened).
    As using *.* selects all the files when l use insert hyperlink and l can select the appropriate one l need.

    Justin

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Default pathname when using 'insert hyperlink'

    I see, so you when you click the "file" button in the dialog box, you want it to display all files.

    I think that to do what you want, you will need to change the field to just a plain text field, and resort to quite a bit of coding.

    If you use a standard file open dialog box, you can set the default path and the default filter in code. If you use that you could retrieve the full path of the selected file with code. Then you would have to mimic the behaviour of a hyperlink using the application.followhyperlink method in code.
    Regards
    John



  5. #5
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default pathname when using 'insert hyperlink'

    Could you tell me how l would go about doing this?
    i.e. where the coding would go and what coding l would need.

    Justin.

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Default pathname when using 'insert hyperlink'

    Justin

    I can pull together an example, but I won't be able to do it until tomorrow.

    (It is 8pm on Friday night here now and I have stopped until tomorrow)

    John
    Regards
    John



  7. #7
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default pathname when using 'insert hyperlink'

    thanks

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Default pathname when using 'insert hyperlink'

    I attach a demo.

    The database has a class module CommonDLG which has all the code needed to provide common dialog boxes.

    The form frmpeople has a wrapper function that provides a front-end to the common dialog stuff.

    So the command button cmdBrowse just calls a function:

    adhCommonFileOpenSave(, "All files,*.*", , , , "Choose a File", CurrentProject.Path, , True)

    You pass it the filter you want, and the initial path., amongst other things. The arguments are documented in the code. The last one , which is either true or false, determines whether the dialog box is an Open or Save dialog box.

    This just inserts the path/filename as a string to a text field.

    The double click events then follows the hyperlink.
    Regards
    John



  9. #9
    5 Star Lounger
    Join Date
    Mar 2004
    Posts
    924
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Default pathname when using 'insert hyperlink'

    I am very confused how l would incorporate this into the database , when l click on the "insert hyperlink" button.
    Please can you explain.

    Thanks
    Justin

  10. #10
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Default pathname when using 'insert hyperlink'

    You have not explained what you are trying to do.

    My assumption is that you want to store a hyperlink in a table, and have the facility to follow the hyperlink from a form.

    My sample replaces the hyperlink field with a text field.

    You originally inserted hyperlinks with the Access Insert hyperlink command. I have replaced that with the Browse, that brings up a standard dialog box.
    (You can change the caption on that button to Insert Hyperlink if you want.)

    You can follow the hyperlink by double clicking it.

    So it seems to me that my sample does what your original one did.

    Whether this is what you really want I don't know.
    **************

    You wanted to be able to set defaults for the path, and the filter. You can do both of these by changing the code behind the "Browse" button.
    At the moment they are set to "All files, *.*," and CurrentProject.path
    Regards
    John



Posting Permissions

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