| | ACC: Sample Function CopyFile() to Copy Disk Files |
 | | This article includes two variations of an Access Basic function called CopyFile(), both of which allow you to copy disk files. |
 | | If you receive the duplicate procedure name error message when you compile or run your code, remove or comment out the appropriate declarations statement from your code. |
 | | '************************************************************** Function CopyFile (ByVal Source$, ByVal Destination$) As Long Dim Index1 As Integer, NumBlocks As Integer Dim FileLength As Long, LeftOver As Long, AmountCopied As Long Dim SourceFile As Integer, DestFile As Integer Dim FileData As String Dim RetVal As Variant Const BlockSize = 32768 On Error GoTo Err_CopyFile ' Remove the destination file. |
| support.microsoft.com /default.aspx?scid=kb;EN-US;Q102671 (804 words) |