Results 1 to 15 of 15
  1. #1
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211

    File Upload

    Without boring or confusing people with the reasoning, here is the following.

    1. On different forms (not all) is an upload button.

    2. There is an upload form for selecting a file and a folder.

    3. The user selects the file for uploading and desired output directory.

    4. When the save button is pressed the file is appended to the folder directory (i.e. saved in the directory).

    The following is an example of what is occurring.
    Click image for larger version. 

Name:	Capture.PNG 
Views:	17 
Size:	18.5 KB 
ID:	32501



    The end-state actually would be a text file that is read by the upload form for its' default directory rather than the user navigating to and selecting one each time, as this increases chance of error.

    I am sure someone has already done this in the past so figured I would ask.

    I found this from Allen Browne, which will come in handy for evaluating whether a file or folder already exists. http://allenbrowne.com/func-11.html

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What is the exact issue?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    text file that is read by the upload form for its' default directory rather than the user navigating to and selecting one each time

  4. #4
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    In the main folder are the following:

    C:\MainFolder
    >frontend
    >backend
    >textfilefordirectory

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The form code is capturing a default path and loading as destination? You want something else to happen - user should select path? Use Windows FileDialog object.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    Already using file dialog. The issue is saving the file to the selected destination and since there are variables the ideal method is to read the destination directory from a text file. This way the user selects the file and everything else is transparent when the save button is clicked. I had the file select and save working before but removed it. Now I am trying to add it back with the addition of a text file that contains the default directory for where it is to be saved. Mind is not cooperating with setting it up so I figured someone else may already have done this.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Not sure what you are asking for. What determines the destination? If user is not to choose, then what rules determine where to save the file?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    The point of the text file is not hard coding the directory into VBA. This way if someone decides to change where files are stored thereafter implementation then they may do so by changing the directory in the text file. That is really the only reason for having a text file.

    The rules will be determined by what form they are located on when they open the file dialog, which will evaluate the form file number at that time and create the directory if it does not exist, which is the reason behind Allen Browne comment of original post. It is just irrelevant for this stage of fixing what I had working once upon a time

  9. #9
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    I will probably start as I usually do. Reading text file as string and then working outwards. This usually does the trick.

  10. #10
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Consider:
    Instead of a text file, I would use a table. That way there could be a form for adding/editing. The form could limit who can change the destination path.
    A text file could be deleted and anyone could modify the text file.

  11. #11
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    Quote Originally Posted by ssanfu View Post
    Consider:
    Instead of a text file, I would use a table. That way there could be a form for adding/editing. The form could limit who can change the destination path.
    A text file could be deleted and anyone could modify the text file.
    That is a great idea, why didn't I think of that. Plus it streamlines setting the default starting directory for all users more easily than changing each config file on each workstation.

  12. #12
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    So this is where I am at so far.

    C:\MainFolder
    >frontend
    >backend
    >>DirectoryConfigTable

    The directory may be a local machine (not good), share drive (ok), or file server (better) for uploading files using the frontend as the interface.

  13. #13
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not sure what
    C:\MainFolder
    >frontend
    >backend
    >>DirectoryConfigTable
    means, but if you have multiple users, EACH user should have a copy of the FE on their computer, the BE should be on a common accessible location, ie a shared drive or file server.
    The "DirectoryConfigTable" (?) would be in the BE.


    My $.02........

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I agree with Steve. If you want to allow ease of changing default path to use for a particular form, use a table to store path strings. The table can have a field to use as criteria for a DLookup().
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    Yes, the examples I gave were more for conceptual and not where the backend will actually be located.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Upload file
    By Erictsang in forum Forms
    Replies: 1
    Last Post: 08-30-2017, 10:18 AM
  2. cannot upload a *.png file
    By Lou_Reed in forum Access
    Replies: 2
    Last Post: 02-23-2017, 11:50 AM
  3. upload a file
    By newbieaccess in forum Access
    Replies: 1
    Last Post: 08-24-2014, 09:41 AM
  4. Text File Upload Issue
    By shabar in forum Access
    Replies: 11
    Last Post: 01-30-2013, 06:35 AM
  5. Upload file inside .mdb database file
    By havish in forum Access
    Replies: 0
    Last Post: 07-30-2008, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums