Results 1 to 2 of 2
  1. #1
    zachir is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    1

    Post creating Automatic Hyperlink

    I'm trying to create automatic hyperlink in a Form Control "hyper" - TextBox.
    The control source of the "hyper" control is a Table field with Hyperlink DataType.
    The files should be addressed from the hyperlinks are scanned PDF files of invoices.
    The invoices are stored in a specific folder "h:\invoices".


    Files are named with the "payment instruction no." which is also a table field And a Form control in tha same Form.
    The hyperlink address has a prefix which is actualy the folder name "h:\invoices".
    How can i create automatic hyperlink that is stored in the "hyper" control & filed from the prefix & "payment instruction no."?

    Regards,
    Zachi

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    So you're trying to open an external file by building a string that will tell you the path/name of the file? or are you trying to display the contents of the file within your access application?

    so let's say this is the file you want to open

    h:\invoices\Instruction100000.pdf

    so to open that file I'd do this in the ON CLICK (button would work fine)

    Code:
    Dim wshshell
    
    Set wshshell = CreateObject("WScript.Shell")
    wshshell.Run """h:\invoices\instruction100000.pdf"""
    Set wshshell = Nothing
    You just have to substitute in your file name on the fly for instance

    Code:
    Dim wshshell
    Dim sFile As String
    
    sFile = [FieldWithPath] & [FieldWithPaymentInstructionName] & ".pdf"
    
    Set wshshell = CreateObject("WScript.Shell")
    wshshell.Run "" & sFile & ""
    Set wshshell = Nothing

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

Similar Threads

  1. Replies: 12
    Last Post: 12-14-2011, 08:04 PM
  2. Creating a Hyperlink
    By dwmackay in forum Forms
    Replies: 1
    Last Post: 09-11-2011, 06:58 PM
  3. Problem creating hyperlink to a sub macro
    By AccessOAP in forum Programming
    Replies: 2
    Last Post: 08-15-2011, 08:05 AM
  4. Replies: 4
    Last Post: 01-31-2011, 03:19 PM
  5. Help On Creating Automatic of a Serial Number
    By lm_lopes in forum Programming
    Replies: 4
    Last Post: 03-10-2010, 06:47 AM

Tags for this Thread

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