Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: file operations (Rename)

    is there a way to rename a file using a microdoft access form?
    the rename action in microsoft access only works on access objects, i need to rename a doc file using a access form. Can anyone help?

  2. #2
    Join Date
    Nov 2003
    Providing you can supply the accurate path to the file in question (or any file for that matter) then you can use the Name function in VBA (do a search in your Access Help for Name Statement).

    Here is a sample (from Access Help):

    Name Statement Example

    This example uses the Name statement to rename a file. For purposes of this example, assume that the directories or folders that are specified already exist. On the Macintosh, “HD:” is the default drive name and portions of the pathname are separated by colons instead of backslashes.

    Dim OldName, NewName
    OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
    Name OldName As NewName ' Rename file.

    OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
    Name OldName As NewName ' Move and rename file.

Posting Permissions

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