Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122

    Multiple File Upoad in Form

    Request for Assistance: Seeking guidance on ensuring the subform correctly displays and manages multiple documents associated with each permit.

    https://drive.google.com/file/d/1PDP...ew?usp=sharing

    Form Views https://drive.google.com/file/d/1KeO...ew?usp=sharing
    Current Setup:


    • Form: frmCultivarPermitFileStore
      • Purpose: Manages file storage related to cultivar permits.
      • Existing Functionality: Currently allows uploading documents but doesn't associate them with specific permits.

    • Table: tblDocumentStorage
      • Purpose: Created to store multiple documents per permit, establishing a one-to-many relationship.
      • Fields Include: DocumentID, PermitID, FileName, FilePath, DocumentType, UploadDate, UploadedBy, Comments.

    Objective:Enhance frmCultivarPermitFileStore to link uploaded documents to their unique PermitID, enabling management of multiple documents per permit.


    Steps Taken:

    1. Backup: Duplicated frmCultivarPermitFileStore to preserve the original.
    2. Form Layout Adjustment: Reorganized existing fields to accommodate a subform.
    3. Subform Integration:
      • Inserted a subform into frmCultivarPermitFileStore.
      • Set Source Object to tblDocumentStorage.
      • Configured Link Master Fields and Link Child Fields to PermitID to establish the relationship.

    4. Testing: In Form View, verified that the subform displays and allows management of multiple documents per permit.

    Issue Encountered:The subform doesn't display related documents as expected.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    How about just giving us what we need to see the problem?
    Not everything. The objects do not even appear to be in order?
    DB does not compile. ?

    Nothing in the link fields in the version I downloaded?
    Nothing in the tables to link to as far as I can see?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    I hope this is better https://drive.google.com/file/d/1I5F...ew?usp=sharing

    The DB is empty for security reasons, the forms should be in tact

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Why can't you just upload to here? Is the zip too big?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    564
    Request for Assistance: Seeking guidance on ensuring the subform correctly displays and manages multiple documents associated with each permit.

    How are you selecting the documents? I'm not sure there's enough information here to answer your question. If you can select the documents through the subform, the LinkChild and LinkMaster properties will basically force the document to be related to the current parent record. "Manages multiple documents"... how do you mean?

    If you have a main form that is bound to the Permit table, and then you have a child table "Document" and it already has a foreign key to the Permit table, then this should work fine. you just do something like use the FileOpenAPI (how 1990s!) to get the file name, you can just grab the PermitID or whatever from the main form and write both of the values into the subform's table.

  6. #6
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    Im having great trouble trying to upload attachedments on this forum, thats why im posting links instead.

  7. #7
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    430
    you put all files (FE/BE) in a .Zip file and attach it on your post.

  8. #8
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    It does not have to be a subform. To simplify it. I can just amend the current form for uploading documents to get the desired results. Please see the form how i currently is in the files i provided. The functionality is made possible with a VBA code. Which you also have access to.
    Attached Thumbnails Attached Thumbnails original permit form.PNG  

  9. #9
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    Most of the time the upload function for files on this forum does not work.

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Quote Originally Posted by yrstruly View Post
    Most of the time the upload function for files on this forum does not work.
    I had that problem with chrome a while back and had to use Firefox, then it was working again with chrome.

    We need data to work with.
    Use this to santize your data, and only supply what we need to see the problem.
    Randomize Data
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    I tried the randomizer, im getting an error. I have attached the file.
    Attached Files Attached Files

  12. #12
    Join Date
    Apr 2017
    Posts
    1,792
    Based on Post# 1, needed are tables like:
    tblPermits: PermitID, ...;
    tblDocuments: DocumentID, ...;
    tblPermitDocuments: PermitDocumentID, PermitID, DocumentID, ...

    Forms needed for managing permit for documents:
    based on post# 1 documents must be linked to permirts, so either
    a) You have a single form based on tblPermits, where a specific permit is selected.
    This form has contionous subform based on tblPermitDocuments. Main form and subform are linked by PermitID.
    b) You have an unbound form with combo to select Permit (linked with PermitID of rowsource query).
    This form has contionous subform based on tblPermitDocuments. Main form and subform are linked by PermitID of subform, and combo in Main form (i.e. fills the text field linked to tblPermitDocuments.DocumentID with DocumentID active in Main form).

    With either of designs, adding a document into subform (adding a row, and selecting the document from combo linked to tblPermitDocuments.DocumentID) automatically links it with PermitID active in Main form

  13. #13
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    It does not have to be a sub form, it can be the form that is already created just amended to resolve what is needed.

  14. #14
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Quote Originally Posted by yrstruly View Post
    I tried the randomizer, im getting an error. I have attached the file.
    Thanks. You've found a flaw in my code but its due to a flaw in yours.

    You have spaces in table and field names which sql doesn't quite like. I never have spaces in any object names and neither should you.
    In code you need to wrap object names with spaces in brackets [ ]

    The error occurs in this line
    Code:
    strSql = "select " & fld & " from " & tbl & " where " & fld & " is not null"
    I'll have to go back and re-post with the following change:
    Code:
    strSql = "select [" & fld & "] from [" & tbl & "] where [" & fld & "] is not null"
    here's an updated copy
    DataRandomizer2025.accdb
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  15. #15
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    Here is the FE n BE with masked data. https://drive.google.com/file/d/14S2...ew?usp=sharing

    Quote Originally Posted by Welshgasman View Post
    How about just giving us what we need to see the problem?
    Not everything. The objects do not even appear to be in order?
    DB does not compile. ?

    Nothing in the link fields in the version I downloaded?
    Nothing in the tables to link to as far as I can see?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Load form file in another access file
    By nd0911 in forum Forms
    Replies: 1
    Last Post: 12-10-2017, 05:19 AM
  2. Replies: 14
    Last Post: 03-21-2017, 07:00 AM
  3. Replies: 1
    Last Post: 08-06-2014, 02:22 PM
  4. Replies: 13
    Last Post: 11-07-2012, 03:14 PM
  5. How do you export a file with a unique file name
    By Budman42 in forum Import/Export Data
    Replies: 1
    Last Post: 10-15-2006, 06:10 PM

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