Re: Help saving files to disk from within Access using VBA
- From: "Colleyville Alan" <nospam@xxxxxxxxxx>
- Date: Sun, 30 Apr 2006 11:41:52 -0500
"Lyle Fairfield" <lylefairfield@xxxxxxx> wrote in message
news:1146398361.534192.287270@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
If you are using a modern version of Access you could try
StrReverse(Split(StrReverse("Alan Colleyville"), " ")(0))
which returns Colleyville.
Thanks - that code works great for splitting out the Name. But I am having
intermittent problems creating the subdirectory.
Here is a snippet that I found on the Interenet:
Dim fso
Dim fol As String
fol = "c:\MyFolder" ' change to match the folder path
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(fol) Then
fso.CreateFolder (fol)
End If
The line "If Not fso.FolderExists(fol) Then" works with no problem. If I
put a msgbox after this line, I get a message.
But when I use the line "fso.CreateFolder (fol)", I got an error message
the first few times I tried it that the function or command was not found.
Once I tried putting in the Msgbox in place of the CreateFolder command to
test it and after I saw that it worked, I commented that out and then
removed the comment from the CreateFolder command. Now it seems to be
working. Any idea what could cause that anomaly?
.
- Follow-Ups:
- Re: Help saving files to disk from within Access using VBA
- From: Lyle Fairfield
- Re: Help saving files to disk from within Access using VBA
- From: Randy Harris
- Re: Help saving files to disk from within Access using VBA
- References:
- Help saving files to disk from within Access using VBA
- From: Colleyville Alan
- Re: Help saving files to disk from within Access using VBA
- From: Lyle Fairfield
- Help saving files to disk from within Access using VBA
- Prev by Date: Re: linking to images with std windows dialog box
- Next by Date: Re: Help saving files to disk from within Access using VBA
- Previous by thread: Re: Help saving files to disk from within Access using VBA
- Next by thread: Re: Help saving files to disk from within Access using VBA
- Index(es):