Skip to main content
Question

How do you show an image on a form from a related table?

  • April 14, 2017
  • 0 replies
  • 97 views

I have a table _DBID_PROJECTS that contains projects. I have a separate table _DBID_DOCUMENT_REPOSITORY that contains various documents and photos with an attachment field (FID: 6) . The two tables are related - one project has many documents.

My question is: How do I get a project image from the document repository table to display on a form in the projects table? I've tried a formula-text field, but the formula isn't working. Any help would be appreciated. 
This topic has been closed for replies.

  • Registered
  • April 14, 2017
I just did this about 15 seconds before you asked the questions, what are the odds.

You will need to decide which image you want to show and get that Record ID# summarized to the parent record.

So if you have some qualifying field on the Documents table that says what type of file is attached, it will be much easier.

Say you have document type of "Photo";  Create a summary field where you are summarizing the ""Minimum" Record ID#, with the condition that "Doc type" is equal to "Photo".

Call it something like [Minimum Photo Record ID#]

Then use this formula in your formula text field on the Projects table.

"<img height=\"80\" src=\"" & URLRoot() & "up/" & [_DBID_DOCUMENT_REPOSITORY] & "/a/r" & [Minimum Photo Record ID#] & "/e6/v0\" />"

  • Author
  • Registered
  • April 14, 2017
Thank you, this is EXACTLY what I needed! Worked like a charm! I'd never created a summary field before, but it was pretty straightforward and easy. Thanks again!