Results 1 to 6 of 6
  1. #1
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150

    Hyperlinks getting #deleted unable to edit record afterwards

    Hello,I don't know if anyone can help, I've got a weird bug that I can't reproduce and am looking for pointers on getting started.

    I have a form with a field called txtDirectory. This is a text box with isHyperlink set to Yes. It is a bound form, bound to a textfield called Directory in the underlying table. It's a text field not a hyperlink field because I find them easier to work with.

    This form allows you to change the status of a task, and when you do it moves the directory to a new location and updates the hyperlink. 99% of the time it works fine and in my attempts to recreate the problem have all failed. Occasionally (it's happened about 6 times for users), when they update the item's details and then click the link (I'm not sure it's always after clicking the link), the link disappears and changes to #deleted. From here there is no way for me to restore the information except going into the back end, copying the whole record, making a copy of it, deleting the original and then putting back in the corrected hyperlink.


    I thought this may be due to long file names, maybe an edge case where it was less than 237 characters (max length mkdir) when the file was created but just over this when the directory was moved, but the directory paths affected are much shorter than this. I've also wondered if it may be due to a document in the drive being open at the time but I've tested that with an open Word document and it causes no problem (Strangely it allows me to move the directory even though the document is open, which I also find odd)

    Any ideas?



    Robyn

  2. #2
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    From an extensive Google search, I've not found anything concrete, but one post suggested this could be a sign of database corruption and to compact and repair. I do this often, but have never thought before. Does a compact and repair effect a linked back end or do I have to go into the back end directly and do it there too?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,952
    Although corruption on BE would probably mean unrecoverable loss of data, C&R can sometimes reduce file size.

    Would have to review code and maybe even db to analyze issue.
    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.

  4. #4
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    Thanks, It's a pain posting code on this computer but I'll try. Essentially it's these few lines, everything before this is just string manipulation

    Code:
            newLoc = Replace(currentPath, findstring, replacestring, , , vbTextCompare) 
    
                   'Move the folder - In the real code there are checks before this to check the original folder exists and the new one doesn't already exist
           fso.MoveFolder Source:=FromPath, Destination:=ToPath
                    ' Update the hyperlink stored in the database
            ' The Move_Rename_Folder command strips off the trailing "\", put it back on.  
          If Right(newLoc, 1)  "\" Then newLoc = newLoc & "\" 
           Me.ACS_Dir = newLoc
       End If   
    
         'Save the record
         If Me.Dirty Then Me.Dirty = False
    Our IM security settings won't let me upload the database, Christ, they don't even let me format text! But thanks for the offer.
    Last edited by Robyn_P; 09-07-2018 at 01:27 AM. Reason: Formatting

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,952
    CODE tag should be forward slash /.

    Looks like missing <> sign

    If Right(newLoc, 1) <> "\"

    However, would expect a compile error and code not run at all.

    Take file home and upload?
    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.

  6. #6
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    Woohoo, silly Robyn on the code tags. Thank-you. Also good spot, that's a direct copy of the code, so when I get a second, I'll look at that. Thanks for your input

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

Similar Threads

  1. Unable to edit data in subform
    By rltaylor in forum Forms
    Replies: 2
    Last Post: 12-07-2016, 06:03 AM
  2. Unable to Edit in SubForm
    By faythe1215 in forum Forms
    Replies: 6
    Last Post: 02-04-2015, 11:19 PM
  3. Unable to edit report in design view
    By gdenham in forum Reports
    Replies: 1
    Last Post: 07-03-2014, 01:05 AM
  4. Unable to edit data in Union table
    By D4WNO in forum Access
    Replies: 2
    Last Post: 08-15-2012, 06:56 AM
  5. Unable to edit Data in Query
    By undee69 in forum Forms
    Replies: 4
    Last Post: 06-10-2012, 10:43 PM

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