I am posting a sample database that shows how to query an attachment field. This is a simple database but was created after assisting a poster who could not find an example. In fact, trying to find sample vba code and or queries to query an attachment field proved to be fruitless.
I found samples of how to add or delete an attachment from a record; and how to use a form to add data to the attachment field in a table. Here is a youtube video for that.
In the demo database, there is a table called Table1. It has 3 fields.
Code:
table_name field_name field_description ordinal_position data_type length default
Table1 ID sample Id PK 0 Long 4
Table1 mname first name (fictitious data) 1 Text 255
Table1 Att demo attachments 2 4
The table has 4 records.
Record ID 1 and 3 have attachments. Records 2 and 4 do not. Record Id 3 has 3 attachments.
The database has queries to show:
-Which Records Have Attachments
-Which Records Do Not Have Attachments
-How any Attachments Are Associated with a Record That Has Attachments
-Which Records Have more Than 2 Attachments
There is a form frm_Table1 that was used to add the attachments to the records in the table.
This is a demo just to show how to query a table that has attachments in Attachment type field.