Operating System Commands Through VBA

R

rmcompute

Can I issue a command to execute operating system commands, for example
creating a directory. I would also have to test if the directory exists
before creating it or handle the error afterward. Is that possible from
within an Access module ?
 
R

Rick Brandt

rmcompute said:
Can I issue a command to execute operating system commands, for
example creating a directory. I would also have to test if the
directory exists before creating it or handle the error afterward.
Is that possible from within an Access module ?

Test to see if directory exists...

If Dir("PathToFolder", vbDirectory) = "" Then
'Directory does not exist
Else
'Directory does exist
End If


To create a directory...

MkDir "PathToFolder"
 
R

rmcompute

It worked. Thank you. Is there a way to get a list of all operating system
commands that can be executed ?
 
R

Rick Brandt

rmcompute said:
It worked. Thank you. Is there a way to get a list of all operating
system commands that can be executed ?

Those are not "operating system commands". They are standard VBA.
 
D

David C. Holley

Snoop through VISUAL BASIC help under functions. You may also want to
look at the File System Object.
 
Top