• how can i use an array (Access 2000)

    Author
    Topic
    #369248

    I have a command that copies databases from only one source to different destinations.
    I want to make an array in order to show the the source database only once?
    For the time being my command looks like that:

    FileCopy strBuSource, strBuDest
    FileCopy strBuSource, strVaDest
    FileCopy strBuSource, strBlDest
    FileCopy strBuSource, strHaDest
    FileCopy strBuSource, strPlDest
    FileCopy strBuSource, strTaDest
    FileCopy strBuSource, strTrdest

    Is it possible to write down only the destinations with one data base source?

    Viewing 0 reply threads
    Author
    Replies
    • #580953

      I’m not quite up on using Arrays, but I’ll take this opportunity to help and to have others check my methods at the same time smile:

      Dim strDest(7) as String
      Dim intCounter as Integer
      
      strDest(1) = "File1"
      strDest(2) = "File2"
      strDest(3) = "File3"
      strDest(4) = "File4"
      strDest(5) = "File5"
      strDest(6) = "File6"
      strDest(7) = "File7"
      
      For intCounter = 1 to 7
          FileCopy strBuSource, strDest(intFileCounter)
      Next

      HTH thumbup

      • #580955

        The question I would have is how you’re getting the destination filenames to populate your array in the first place. Are these a hard-coded list or do you populate it from a Dir function, or what? Also, you need the full path for the destination, not just the filename itself. So you either have to include that in the array value or concatenate it to the array value in the FileCopy command (assuming the destination files are all in the same path).

    Viewing 0 reply threads
    Reply To: how can i use an array (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: