UNION ALL with Attachment data type
UNION ALL with Attachment data type
(OP)
thread700-1724615: Access 2010 UNION ALL with Attachment data type
Good afternoon guys, I'm very new to this.
I was just wondering if anyone can elaborate on what the code would look like for the answer by Programmer dhookom on thread700-1724615: Access 2010 UNION ALL with Attachment data type.
Any help would be really helpful. Thank you all!
Good afternoon guys, I'm very new to this.
I was just wondering if anyone can elaborate on what the code would look like for the answer by Programmer dhookom on thread700-1724615: Access 2010 UNION ALL with Attachment data type.
Any help would be really helpful. Thank you all!
RE: UNION ALL with Attachment data type
And then use this query in your ‘regular’ SQL like any other table:
---- Andy
There is a great need for a sarcasm font.
RE: UNION ALL with Attachment data type
(Union Query)
SELECT
[Last Name],
[First Name]
FROM [Students]
UNION ALL
SELECT
[Last Name],
[First Name]
FROM [Students Archive 2-4 years old]
UNION ALL
SELECT
[Last Name],
[First Name]
FROM [Students Archive 4-6 years old];
(Add Attachments Query)
SELECT
[Last Name],
[First Name],
[Attachments]
FROM [Students] Left Join [Union Query]
Result: Syntax error in FROM Clause
RE: UNION ALL with Attachment data type
Do you have a primary key field? Last and first names are quite often not unique. What table(s) have the Attachments field?
CODE --> sql
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: UNION ALL with Attachment data type
---- Andy
There is a great need for a sarcasm font.
RE: UNION ALL with Attachment data type
Sorry I'm going back and forth on this...
But this worked out great but unfortunately All Tables have attachments.
Is there a way to combine all attachments into one column? I have a form with a button that opens attachment management.
RE: UNION ALL with Attachment data type
I would try create a single column with an expression like:
CODE --> sql
I'm not optimistic that Nz() works with an attachment field. You may need to run append queries to add all of the records into a temporary single table.
BTW, please copy and paste the SQL statement rather than giving us an image.
Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
RE: UNION ALL with Attachment data type
Thank for the advice but like you predicted, it did not work.
Unfortunately since SharePoint has a limit of 5000 items per list, so we are forced to move (archive) student files automatically using Microsoft Flow.
It just would be nice if all lists
A [students]
B [students archive 2-4 years old]
C [students archive 4-6 years old]
would all be searchable from one Form in Access. Which is, thanks to UNION ALL and LEFT JOIN.
But if a particular student is in B but the Access Form's control source is A.Attachments. It'll come back with an error, obviously because the student's attachments are in the B.Attachmetns column not int the A.Attachments column
I tried "=Nz(A.Attachments,Nz(B.Attachments,C.Attachments)) " in the Access Form's control source as well, it did not work.
I'll look into how running append queries to a single table works. Thanks for the suggestion.
RE: UNION ALL with Attachment data type
Consider this:
One more table:
And instead of 3, you have just one table (with Attachments)
---- Andy
There is a great need for a sarcasm font.