Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy to different destinations (Access 2000)

    I want to copy from only one source but to different destinations.How can i rearrange the function so as to put in the brackets only the destination as copyBAS(BASMF)
    i use the following function
    Public Function CopyBAS()
    Dim strSource As String
    Dim strDest As String
    strSource = "C:BEStoreBAS.mdb"
    strDest = "C:BEBASMF.mdb"
    FileCopy strSource, strDest
    End Function

    i want to rearrange it to make easier to enter the destination only

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: copy to different destinations (Access 2000)

    Try this:
    <code>
    Public Function CopyBAS(strTarget As String)
    Dim strSource As String
    Dim strDest As String
    strSource = "C:BEStoreBAS.mdb"
    strDest = "C:BE" & strTarget & ".mdb"
    FileCopy strSource, strDest
    End Function
    </code>
    Call it like this:
    <code>
    Call CopyBas("BASMF")
    </code>
    or
    <code>
    CopyBas "BASMF"
    </code>
    Note the quotes around the name, and the absence of parentheses in the second example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •