Ah...
I'm not sure about a vba function to validate a prospective folder name. I
thought you meant to check for the existence of that folder first.
I suppose an alternative would be to run the mkdir command, and before going
much further, check to see if that directory now exists (using the Dir
function). If it doesn't exist, obviously there was some error creating it,
and you can abort your treeview process. For example, have a 'dummy' folder
set up in your db location to perform this test before starting on the
treeview.
That would be the only way that I know off the top of my head, though it
does seem as thought there would be an API to handle something like this.
Probably there is, I just don't know of it.
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
"Rich K" wrote:
> Actually, the MkDir($Name) function is perfect for creating a folder with the
> name $name.
> What I'm looking for is a function that will varify if $Name is a valid
> windows folder name before I pass it. I'm building the folders while
> simultaneously building a tree view. I have to build the tree view first,
> and then create the folder.
>
> If I can validate the folder name prior to the tree view, I can simple abort
> the process, but if I have to wait until I try to create the folder to find
> out if it can be created, I would have to roll back several functions.
>
> Thanks.
>
> "dymondjack" wrote:
>
> > Check out the Dir() function
> >
> > If you look at the help file, it will tell you how to use the arguments.
> > One of them can be used for dealing with directories. I don't remember the
> > syntax offhand, but if you should be able to pass the proposed name and the
> > vbDirectory constant to check for the existance of the folder.
> >
> > hth
> >
> > --
> > Jack Leach
> > www.tristatemachine.com
> >
> > - "First, get your information. Then, you can distort it at your leisure."
> > - Mark Twain
> >
> >
> > "Rich K" wrote:
> >
> > > I'm automating the creation of windows folders from a stored procedure in an
> > > Access Module. I ask the user for a name for the folder after he's
> > > identified the location.
> > > What I'm looking for is code that varifies that the name is a valid windows
> > > folder name before I try to create it. Is there something built into vba for
> > > this purpose?
> > >
> > > Thanks.