Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    74

    Unanswered: check and save filename

    hi,

    how can i retrieve the filename in that folder???

    i wanted to save a file and how do i check that i do not overwrite the file i have in the folder???

    example. i have a file named "AccessDB.mdb" and i want to make a copy and named it "AccessDB1.mdb"
    how do i have an auto increment number behind the filename??? if another user copy the file again, how can i force it to saved as "AccessDB3.mdb"???? how can i check if there is same filename in MY FOLDER????


    pls advice
    nono

  2. #2
    Join Date
    Nov 2003
    Location
    Makati City, Philippines
    Posts
    14

    Re: check and save filename

    have you used the FileSystemObject object access vba has to offer? it has plenty of methods that you could use for specific tasks.

    1) to retrieve a filename you use the GetFile method.
    2) FileExist method would tell you wheter the file parameter entered exists or not, then you do the saving by using the FileCopy method

    the rest would be up to your programming technique on how you would save the file increments. hope i was able to help in my own little way.

    cheers,
    ReggieSter

    Originally posted by damnnono_86
    hi,

    how can i retrieve the filename in that folder???

    i wanted to save a file and how do i check that i do not overwrite the file i have in the folder???

    example. i have a file named "AccessDB.mdb" and i want to make a copy and named it "AccessDB1.mdb"
    how do i have an auto increment number behind the filename??? if another user copy the file again, how can i force it to saved as "AccessDB3.mdb"???? how can i check if there is same filename in MY FOLDER????


    pls advice
    nono

  3. #3
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: check and save filename

    Originally posted by damnnono_86
    hi,

    how can i retrieve the filename in that folder???

    i wanted to save a file and how do i check that i do not overwrite the file i have in the folder???

    example. i have a file named "AccessDB.mdb" and i want to make a copy and named it "AccessDB1.mdb"
    how do i have an auto increment number behind the filename??? if another user copy the file again, how can i force it to saved as "AccessDB3.mdb"???? how can i check if there is same filename in MY FOLDER????


    pls advice
    nono
    If you use the objects that ReggieSter is refering to, you will need a reference to the Microsoft Scripting Runtime library.

    Gregg

  4. #4
    Join Date
    Nov 2003
    Posts
    74
    hi,

    i think i have posted twice for this topic. i have attached a db at this link

    http://www.dbforums.com/t971325.html

    i do not know to make a hyperlink here so soory for the inconvenience. i think in the coding, i have done somthing wrong on it.

    pls advice
    nono

Posting Permissions

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