Hi all. I am trying to rename a directory with the following. It gives an error message "path/file access error" on line "Name OldName AS NewName". I am trying to change the folder name holding a BE file before relinking to that file. If I hold the cursor above Name if get the name of the form that is open. Trying to use the Name Statement of the Dir function, but guess I don't understand it fully. Thanks for any advice in advance.
Dim sFileName As String
Dim OldName, NewName
Dim appAccess As Access.Application
Dim DBS As Database
Dim rst As Recordset
Dim tdf As TableDef
Dim tdfs As TableDefs
Dim RefreshLinks As Boolean
Dim tableName As String
Dim tdfNew As TableDef
Dim dbs2 As Database
Dim fld As Field
Dim prpLoop
commondialog1.InitDir = "C:\My Documents"
commondialog1.Filter = "All DataBase Files (*.mdb)|*.mdb"
commondialog1.Flags = &H1000& Or &H800&
commondialog1.FilterIndex = 1
commondialog1.DialogTitle = " Select The Taxpayer File That You Want To Continue. "
commondialog1.ShowOpen
sFileName = CurDir(CurrentDb.Name)
OldName = sFileName
NewName = Left(OldName, 16) & "S" & Mid(OldName, 17)
Name OldName As NewName
Dim sFileName As String
Dim OldName, NewName
Dim appAccess As Access.Application
Dim DBS As Database
Dim rst As Recordset
Dim tdf As TableDef
Dim tdfs As TableDefs
Dim RefreshLinks As Boolean
Dim tableName As String
Dim tdfNew As TableDef
Dim dbs2 As Database
Dim fld As Field
Dim prpLoop
commondialog1.InitDir = "C:\My Documents"
commondialog1.Filter = "All DataBase Files (*.mdb)|*.mdb"
commondialog1.Flags = &H1000& Or &H800&
commondialog1.FilterIndex = 1
commondialog1.DialogTitle = " Select The Taxpayer File That You Want To Continue. "
commondialog1.ShowOpen
sFileName = CurDir(CurrentDb.Name)
OldName = sFileName
NewName = Left(OldName, 16) & "S" & Mid(OldName, 17)
Name OldName As NewName