Results 1 to 8 of 8
  1. #1
    thescottsman92 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    13

    Edit Hyperlink by removing a part of the link and adding the link

    Hi All

    I have been stuck on this for a while now.



    I have a file in a certain location. What I want to do is copy the file into a new location that is similar to the old location but not the same. This location will also change everytime there is a different folder.

    I have managed to find a way of locating the parent folder such as
    s:\test\test2\drawing

    What I want is to copy the file on the click of a button to something like
    s:\test\test2\archive

    I hope this isn't too confusing

    Grateful of all your help

    thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Do you want to edit the hyperlink value in table field or do you want to physically copy file?

    A hyperlink is just a text string. Review http://www.allenbrowne.com/casu-09.html
    Should be able to use Replace() function.
    Can use HyperlinkPart function to reference parts of hyperlink http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    thescottsman92 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    13
    Hi

    Many thanks for the reply

    I think the replace function would work, however the problem is that the text I want to replace is in another textbox, would this be possible to do. Currently I have:

    Dim lresult As String
    lresult = Replace([Folder Path], "01 3D MODELS", "Archive")

    In the afterupdate event of the textbox I want the new name to appear in

    Many tyanks for all your help

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Don't understand. You want to enter something in a textbox and in the textbox AfterUpdate event change the value of another textbox?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    thescottsman92 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    13
    sorry I have a textbox which contains a link. This textbox shows the link of a file from a table.

    The text displayed in that textbox will be the link s:\test\test2\01 3D MODELS

    In a different textbox I want to replace the "01 3D MODELS" to archive.

    The reason why I need to have it as a textbox is because I have thousands of files and lots of folders in different locations does this help?

    thanks

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Maybe:

    Sub textboxname_AfterUpdate()
    Me.othertextboxname = Replace([Folder Path], "01 3D MODELS", "Archive")
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    thescottsman92 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    13
    Hi

    I have entered this code

    Private Sub ParentFolder_AfterUpdate()
    Me.NewArchive = Replace(Me.ParentFolder, "01 3D MODELS", "Archive")
    End Sub

    It is not working 100% the file name is the same and does nave the text replaced anyideas?

    thank you so much for your help

  8. #8
    thescottsman92 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    13
    sorry my mistake I mistyped something

    itsw now working

    thanks for your help

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

Similar Threads

  1. Link Pictures & Adding Browse Button
    By OldGreg134 in forum Access
    Replies: 1
    Last Post: 06-29-2012, 01:02 PM
  2. Replies: 1
    Last Post: 07-26-2011, 05:18 PM
  3. Link Master Field and Link Child Field
    By evander in forum Forms
    Replies: 2
    Last Post: 05-25-2010, 09:13 PM
  4. Creating "Edit Record" link in table column
    By joshearl in forum Forms
    Replies: 1
    Last Post: 12-25-2009, 11:17 AM
  5. Replies: 0
    Last Post: 01-18-2007, 07:07 PM

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