Use runCode action line in macro.
At the bottom of the screen goes FunctionName()
If you copy code from a post/Google it will often look like
FileCopy "C:\LettersCopy\0Letter1Mike.doc", "c:\Letters\0Letter1Mike.doc"
Or
Private Sub Command369_Click()
FileCopy "C:\LettersCopy\0Letter1Mike.doc", "c:\Letters\0Letter1Mike.doc"
End Sub
The above is being run from a button on a form.
You need to have the code in a module which in turn will mean a function name.
Here is exactly the same sort of thinh in a module
Public Function ToLaptopDell()
FileCopy "C:\ViperResides\Viper.mdb", "
\\MikeLaptop\ViperDaily\" & Format([Forms]![CodeBUSystem]![Current6]) + ".mdb"
Forms!CodeBUSystem!TimeStart = 1
End Function
ToLaptopDell() would go in a macro or if it is called from within code the () are dropped.
Code you get from postings and Google will often have Me in it and for a module put full form name.