Automating Create New Folder

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

Hi: Using Access 2002 windows XP pro
Any way to create a new folder from Access and name it from the data in a
field.
I would like to use a macro if possible. Thanks, Ed
 
Hi: Using Access 2002 windows XP pro
Any way to create a new folder from Access and name it from the data in a
field.
I would like to use a macro if possible. Thanks, Ed

In VBA the command is: MkDir "MYDIR" (see help).

In a macro I don't know. But if you want to take the name from a field it's
definitely easier in the form's class module.

HTH - Peter
 
A macro won't do this directly. Use VBA code (you can call a function from a
macro, and have that function run the VBA code).
 
Thanks, Any simple examples out there?

Ken Snell said:
A macro won't do this directly. Use VBA code (you can call a function from a
macro, and have that function run the VBA code).

--
Ken Snell
<MS ACCESS MVP>

in
 
You'd need to put a public function in a regular module:

Public Function NameAndCreateNewFolder()
MkDir Forms!FormName!ControlName
End Function

(Substitute the real names for the generic ones I've listed above:
FormName; ControlName.)

Then use the RunCode action in a macro, and put NameAndCreateNewFolder() as
the function name.

Note that MkDir requires the full path to the new folder, unless you want
the new folder to be in whichever path is the current default path.
 
Back
Top