• Enumerating paths (Access 2000)

    Author
    Topic
    #439530

    How could i enumerate the paths in the simple If Dir(path,vbNormal) condition ? For example i have the following lines :
    If Dir(AuPl, vbNormal) “” Then
    GetIt (AuPl)
    Kill (AuPl)
    FncSuborder
    FinishingTouches

    I want to rewrite the If condition as follows

    If Dir(AuPl,or VAOL,Or TrPL,Or TYUL, vbNormal) “” Then

    GetIt(AuPl Or VAOL or TrPl Or TYUL)

    Is it possible?

    Viewing 0 reply threads
    Author
    Replies
    • #1050555

      What does Getit do?

      What you could do is have a loop that loops thru all files, then test inside the loop for the various filenames you want then do what you want to do.

      What are AuPl Or VAOL or TrPl Or TYUL?

      • #1050556

        GetIt is a function that is performed when one of the databases shown with the pah is present.AuPl, VAOL etc are different paths to the databases
        For example the lne
        If Dir(“C:BEDepotsDepotVa.mdb”, vbNormal) “” Then
        can be replaced with
        If Dir(AuPl, vbNormal) “” Then…
        In this case AuPl etc is a constant showing the corresponding path

        My question is can i rewrite the If DIR(path,vbNormal) condition so as to include the other path too
        For example If DIR(AUPl, Or VAOL,vbNormal) “” Then

        • #1050559

          No you cannot do that as far as i know.
          You may need a separate loop for each path, or setup a function that accepts a path name and do it in one loop in the function.

          you may need to change your Dir function toshow vbDirectory as the 2nd parameter.

        • #1050558

          You cannot do it that way. Dir doesn’t understand multiple paths. Instead, create a procedure like this:

          Sub ProcessIt(strPath As String)
          If Dir(strPath, vbNormal) “” Then
          GetIt strPath
          Kill strPath
          FncSuborder
          FinishingTouches
          End If
          End Sub

          You can then call it like this:

          ProcessIt AUPI
          ProcessIt VAOL
          ProcessIt TRPI
          ProcessIt TYUL

          • #1050568

            Thank you. it is a marvelous solution indeed.Very concize and bullet proofed

    Viewing 0 reply threads
    Reply To: Enumerating paths (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: