Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    Refering to the table (Access 2000)

    I want to build function that clears the files listed in the table ListDB. This table consists of two fields, Folder and DatabaseList.I have to copy manually the paths for example Kill "C:bebe.mdb "
    but is it possible to refer to them from the table directly in code?

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 16 Times in 16 Posts

    Re: Refering to the table (Access 2000)

    You could use something like this:

    Sub DeleteFiles
    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset
    Dim strPath As String
    Dim strFile As String

    On Error GoTo ErrHandler

    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("ListDB", dbOpenDynaset)
    Do While Not rst.EOF
    strPath = rst!Folder
    If Not Right(strPath, 1) = "" Then
    strPath = strPath & ""
    End If
    strFile = rst!DatabaseList
    Kill strPath & strFile

    On Error Resume Next
    Set rst = Nothing
    Set dbs = Nothing
    Exit Sub

    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

Posting Permissions

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