Solved Add attachment (pic) to a report. (1 Viewer)

DBrodin

Registered User.
Local time
Today, 12:18
Joined
Mar 5, 2011
Messages
21
I am trying to modify a database that I did for convention registration many years ago to print photo name tags for a reunion. My structure is a table (sheet 1) with names and a photo in an attachment field, a form (check-in) to select a record, and a report (Name tag) based on the record displayed in the form. I used this setup to print name tags without photos for years. The form loads and displays the name and photo correctly, but the image does not load in the report. My code for the attachment box of the report is
Code:
=[Forms]![Check-in]![photo]
. I am at a loss as to why the attachment loads in the form, but not in the report.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:18
Joined
Oct 29, 2018
Messages
21,358
Did you use an Attachment control instead of a Picture control?
 

DBrodin

Registered User.
Local time
Today, 12:18
Joined
Mar 5, 2011
Messages
21
The photos are in an attachment field in the table, and attachment controls in both the form and the report.
Screenshot (125) copy.jpg
 

bastanu

AWF VIP
Local time
Today, 10:18
Joined
Apr 13, 2010
Messages
1,401
Your report should be based on the same table or query as the form and the control source of the attachment control on the report should not mention the form at all, should simply be [Photo].

Cheers,
 

DBrodin

Registered User.
Local time
Today, 12:18
Joined
Mar 5, 2011
Messages
21
That brings the photo across, but it is loading every record. How do I limit it to the record selected in the form?
 

DBrodin

Registered User.
Local time
Today, 12:18
Joined
Mar 5, 2011
Messages
21
SELECT * FROM [Sheet 1] WHERE ID = Forms![Check-in]![ID]
That did the trick!:D
I taught myself just enough Access ten years ago to write the database for political conventions that tracked who was present, and from what district, along with about a dozen reports. The name tag module I added about six years ago as an update. Adding photos to the mix was new territory for me. Thanks!!
 

bastanu

AWF VIP
Local time
Today, 10:18
Joined
Apr 13, 2010
Messages
1,401
You're very welcome, good luck with your project!

Cheers,
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:18
Joined
Oct 29, 2018
Messages
21,358
Glad to hear you got it sorted out. Cheers!
 

Users who are viewing this thread

Top Bottom