Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using FileSystemObject to upload Word docs (Access 2000)

    Hello all!

    Ok, this is going to be a long question, so I apologize up front. [img]/forums/images/smilies/sad.gif[/img]

    I have created an Access application to record information on bugs found in a current Web application we use here at work. For example, a Business Analyst is testing the Web Application and finds a bug. They would then go to this Access application to log the bug. In some instances the Business Analyst may have additional notes or screen shots of the error that they have saved into a Word document. I want to provide the ability for an Analyst to upload these Word documents using a button on one of the Access application's forms which will prompt them with a pop-up letting them navigate to and select the file they want to upload. Then, the Access application will make a copy of that file and place it into a folder in the same directory the Access application is located. I was going to create another table that would have the id of the bug and the document name of the uploaded file so that any bug could have more than one document associated with it. I was also toying with the idea of creating a folder for each bug (using the bug's ID number) and placing all of the Word documents associated with it into the folder that corresponds to the bug. That way, files could have the same name as long as no 2 files associated with the same bug had the same name. Following me? Anyway, then I wanted to somehow create a way for an Analyst or Developer to go back in to the Access application, locate the bug and then view the Word documents associated with it (I want them to be able to download them onto their machine from the Access application) so they can view them.

    I am sorry if this is way too much to ask, but any assistance, as always, is greatly appreciated! I already have the Access application written so that I can enter a new bug and go in and search for and bring up an existing bug record. Now I need to add buttons and code to allow Word documents to be uploaded to the server where the actual Access application resides and then create a way to download the documents back down to the viewer's machine.

    Regards,

    Amanda

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Using FileSystemObject to upload Word docs (Access 2000)

    What you want to do sounds reasonable and achievable to me.

    You could use the FileSystemObject, but Access also contains a number of older DOS style commands that will also do the job.

    Filecopy will copy a designated file to a designated location.
    Dir will check for the existence of a file or folder
    MkDir will make a directory (folder).

    The thread beginning with <post#=188188>post 188188</post#> talks about how to create a file dialog box that will allow the user to select the Word document they want to upload.
    Regards
    John



  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using FileSystemObject to upload Word docs (Access 2000)

    If there will never be more than one document per bug log entry, you could name the document with the primary key (e.g., autonumber) of the log entry.

  4. #4
    Lounger
    Join Date
    Apr 2002
    Location
    St. Paul, Minnesota, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using FileSystemObject to upload Word docs (Access 2000)

    Ok, I guess I am going to need more help. I tried copying and pasting the code from that post you listed above and I am not even sure where I went wrong, all I know is it didn't work.

    I guess to start out, I would like to create a button to upload one document at a time from the user's machine up to the server where the database is located. I've been trying to read all I can about the FileSystemObject and it's properties and methods, but I don't see anything about opening a "dialog box" and allowing the user to select the file they want to upload. Can anyone elaborate further and provide some well documented code to get me started?

    Thanks!

    Amanda

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Using FileSystemObject to upload Word docs (Access 2000)

    I attach a little db which has a form that allows you to select a file to upload.

    It also has an upload button that copies the selected file to the location of the current db location.

    I have left in a series of message boxes to show results of each step.

    This doesn't use the filesystemobject, just the filecopy command.

    It uses currentProject.path to find the location of the db. If you use a Front End on the local machine that won't work. Instead you will find a function in the Main module that can be used to find the network path, if you insert one of your table names, and perhaps adjust the numbers.)
    Attached Files Attached Files
    Regards
    John



Posting Permissions

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