I am building a database to store and organize e-book content. I have a Books table, Chapters table and a Content table to store pieces of content. Also, each chapter is related to an HTML template so I have a table called Templates and since the templates are a compilation of HTML code, I have a Code table representing the bits of code that are assembled to create the templates. I have join tables to join Chapters to Content, Chapters to Templates, and Templates to Code. Finally, I have a layout based on the Chapters table with a portal to the Chapters/Content join table so I can assign content to the chapter. My final step which I am unable to complete is to relate each piece of content (called elements) in that chapter to a HTML code field that is related to the chapter through the Template related to that chapter. My understanding is that I need a filtered result and I've spent hours reading and experimenting but have been unsuccessful in making the connection. I'd be very appreciative of any input.