Hi all,
I have never used the Name statement before and I want to rename some filenames to match the path/filename stored in the db.
The format is Name oldname As newname
The code is simple enough, where it uses a recordset which supplies the oldname and the code assembles the newname by taking the [LatinName] and adding it to the path, as below, and loops through the records replacing the filenames (complete with the full path). The recordset is not affected by the process so it doesn't require any Update.
The trouble arises on the firsts record where, although the path/filenames are both valid, an error 53 - file not found pops up.
The two path names are:
oldname = "C:\Access Files\OurGardenPics\Finicia 'Ice Crystals'.jpg"
newname = "C:Access Files\OurGardenPics\Finicia truncata 'Ice Crystals'.jpg"
The oldname tallies with the Folder filename so it should find that one.
The newname is created and the format/syntax etc., appears to be correct.
The odd thing is that I noticed was that when I hover the cursor over the statement - Name, in the Debug mode, (when the error arises and the line of code is highlighted in yellow), I get the Form name appearing... ("ImageTest").
I've tried all that I can think of to solve this one so I'm asking for help.
Any ideas/suggestions/solutions would be appreciated, as always.
Thanks Dave E
I have never used the Name statement before and I want to rename some filenames to match the path/filename stored in the db.
The format is Name oldname As newname
Code:
Myset.MoveFirst
Do Until Myset.EOF
TableName = Myset![Picture]
FolderName = "C:\Access Files\OurGardenPics\" & Myset![LatinName] & ".jpg"
Name TableName As FolderName
MCount = MCount + 1
Myset.MoveNext
Loop
The code is simple enough, where it uses a recordset which supplies the oldname and the code assembles the newname by taking the [LatinName] and adding it to the path, as below, and loops through the records replacing the filenames (complete with the full path). The recordset is not affected by the process so it doesn't require any Update.
The trouble arises on the firsts record where, although the path/filenames are both valid, an error 53 - file not found pops up.
The two path names are:
oldname = "C:\Access Files\OurGardenPics\Finicia 'Ice Crystals'.jpg"
newname = "C:Access Files\OurGardenPics\Finicia truncata 'Ice Crystals'.jpg"
The oldname tallies with the Folder filename so it should find that one.
The newname is created and the format/syntax etc., appears to be correct.
The odd thing is that I noticed was that when I hover the cursor over the statement - Name, in the Debug mode, (when the error arises and the line of code is highlighted in yellow), I get the Form name appearing... ("ImageTest").
I've tried all that I can think of to solve this one so I'm asking for help.
Any ideas/suggestions/solutions would be appreciated, as always.
Thanks Dave E