Form display many to many relationship

miha

New member
Local time
Today, 04:41
Joined
Dec 22, 2011
Messages
4
I have made simple example from many to many relationship database.
As form goes through AuthorID fields - subform must show multiple books written by Author.
The problem is that I have middle table where I would like Books table.
264qtlz.jpg
 
Welcome to the forum!

The approach I usually use is to replace the BookID control in the subform with a combo box that is tied to the book table. Make sure that the combo box brings in the ID value from the book table, the title, the year published and any other fields you want to see in the subform. So, the row source property of the combo box would look like this

SELECT ID, Title, Published...FROM tblBooks


You can then add some controls to the subform and reference those others fields in the combo box in that control using the following expression

(you will have to replace comboboxname below with the actual name of your combo box).

=comboboxname.column(x)

x=number of the column you want, Access starts numbering columns at zero

So if you wan the year published, the expression would look like this based on the row source I show above.

=comboboxname.column(2)
 
Thank you. You are great!
 
You're welcome. Please post back if you run into any questions when you set up your form/subform.
 

Users who are viewing this thread

Back
Top Bottom