Steps I took to Link Document Storage to Permit Information in MS Access
1. Created tblDocumentStorage Table
- Since document details were missing, I created a new table tblDocumentStorage with columns:
- DocumentID (AutoNumber, Primary Key)
- PermitID (Number, Foreign Key)
- FileName, FilePath, DocumentType
- UploadDate, UploadedBy, Comments
- Ensured PermitID references tblPermitInformation.PermitID for linking.
2. Modified qryPermitInformation Query to Include Documents
Code:
SELECT tblPermitInformation.PlantID, Plants.Cultivar AS Variety, Plants.Clone, tblPermitInformation.PermitID, tblPermitInformation.Import_Requestor, tblPermitInformation.Permit_No, tblPermitInformation.Permit_appl_date, tblPermitInformation.Permit_valid_until, tblPermitInformation.Authorization_application_date, tblPermitInformation.Authorization_no, tblPermitInformation.Authorization_valid_until, tblPermitInformation.Date_shipped, tblPermitInformation.Arrival_date, tblPermitInformation.Export_country, tblPermitInformation.Material_type, tblPermitInformation.Quantity_of_material, tblPermitInformation.Import_comments, tblPermitInformation.FumigationStatus, tblPermitInformation.PermitAuthApprovedDate, tblPermitInformation.ExpectedReleaseDate, tblDocumentStorage.FileName, tblDocumentStorage.FilePath, tblDocumentStorage.DocumentType, tblDocumentStorage.UploadDate, tblDocumentStorage.UploadedBy, tblDocumentStorage.CommentsFROM (tblPermitInformation INNER JOIN Plants ON tblPermitInformation.PlantID = Plants.PlantID) LEFT JOIN tblDocumentStorage ON tblPermitInformation.PermitID = tblDocumentStorage.PermitID
ORDER BY Nz(Plants.Cultivar, ''), Nz(Plants.Clone, '');
- Previously, qryPermitInformation joined tblPermitInformation and Plants.
- I updated the query to include tblDocumentStorage using a LEFT JOIN on PermitID,
- Form frmCultivarPermitFileStore was never linked to a data source. It only imports files.
- I connected qryPermitInformation as its data source and got the following message, which i clicked No:
�� To complete this operation, Access must modify the RecordSource property of the current form or report.
"Access will create a new query and embed it directly into the form’s or report’s RecordSource property. The form or report will no longer be based on the qryPermitInformation query."
Do you want to accept this change?
✅ Yes | ❌ No
I could not load newly created document tables column on the form mentioned. Only when i unlinked the data source, i could.
- What am i suppose to do in this regard?