Results 1 to 4 of 4
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    unable to delete a hyperlink record

    i have a self populating combo box which allows users to choose a database to connect to for back-end data. the list is poulated with databases that they have preiously connected to...


    the table the combo box gets its records from includes fields for project name, last date accessed, and a hyperlink field [FilePath] to the file

    when a file not found error occurs (files get moved, renamed, deleted...) i wrote a short snippet to delete the record from the table
    and to do this, i reference the FilePath hyperlink field of the record (there may potentially be multiple records with the same project name etc.)

    initially the variable strFileName (which I've previosly been using in the function) has a value of:
    C:/path/file_name.mdb#C:/path/file_name.mdb#

    the next line parses the value to be:
    C:/path/file_name.mdb
    strFileName = Mid(strFileName, InStr(1, strFileName, "#") + 1, Len(strFileName) - InStr(1, strFileName, "#") - 1)

    however the following code, which does not result in any error (at least that I can see), does not delete the record

    sSQL = "Delete from tblChangeProjectList" & _
    " WHERE tblChangeProjectList![FilePath] = '#" & strFileName & "';"
    CurrentDb().Execute sSQL, dbFailOnError

    after many hours of self-imposed frustration, i give up
    if ANYONE has ANY thoughts, they will, in advance, be greatly appreciated
    Mark

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Try LIKE and wildcards. Worked for me.

    "DELETE FROM tblChangeProjectList WHERE [FilePath] Like '*" & strFileName & "*'"
    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
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    <thanx, will try tonight and get back to you> -mark

  4. #4
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    you get to be hero for the week!!
    (it worked, thnx)

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

Similar Threads

  1. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  2. Unable to add a record on a form
    By JamiB1979 in forum Forms
    Replies: 1
    Last Post: 06-22-2011, 08:36 PM
  3. Unable to create new record in Forms
    By escapades_access in forum Forms
    Replies: 5
    Last Post: 03-16-2011, 03:23 PM
  4. unable to add new record
    By itsmemike in forum Forms
    Replies: 2
    Last Post: 08-24-2010, 04:23 AM

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