You'd call that in a module. However, Shell is a function: you're supposed
to have a variant variable to which you can assign its return value:
Dim varReturn As Variant
varReturn = Shell(...)
or else call it:
Call Shell(...)
As well, if there's a chance that what's in DirTextBox can contain spaces,
you'll need quotes around the folder details:
Shell ("xcopy ""c:\MainDirectory\"& [forms]![MyForm]![DirTextBox] & "\*.*""
/s /y C:\TargetDir")
In fact, since MainDirectory is more than 8 characters, you might want to do
that even if DirTextBox will never contain spaces.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"kev100 via AccessMonster.com" <u16246@uwe> wrote in message
news:640004cee6ee1@uwe...
|