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?
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.