RobertJohn
Registered User.
- Local time
- Today, 09:49
- Joined
- Mar 24, 2008
- Messages
- 14
Hi all.
I am a beginner using Access 2007 to try to develop a small home library application to store details of my book collection. So far I have three tables as follows:
Table 1 Books has fields Book_ID (AutoNumber, Primary Key) and Title.
Table 2 Authors has fields Author_ID (AutoNumber, Primary Key), First_Name and Last_Name.
(These will be extended to include details like Publisher, fiction or non-fiction etc when I get my basic structure right.)
Table 3 Books_Authors with fields Book_ID and Author_ID (both Number fields and both Primary Keys).
This third table (I think it is called a junction table) is there to enable a many-to-many relationship between Books and Authors, as one author can have several books and one book may have several authors. I have created a one-to-many relationship between Books and Books_Authors on the Book_ID field, and a similar one-to-many relationship between Authors and Books_Authors on the Author_ID field.
I have developed a data entry form based on my Books table which allows me to enter a book title and then go to a subform to enter author details for that book. That works fine. But because I have several books by the same author I don't want to have to enter the author details every time. Instead when I get to the Author subform I would like to be able to use a lookup table in a Combo box, (based on my Authors table) using the author's full name { [First_Name] & " " & [Last_Name]} so that I can just click on the author I want. If the author I want is not on the list already I will use a button on the form to take me to another form to enter a new author. That part is OK.
I was sent a sample database which was very similar to the one I want and it worked OK. However when I tried to replicate it, by building it up from scratch, I was unable to achieve the same result. As I am trying to learn about Access I don't want to just copy someone else's database, although I thought at the time that I would be able to re-create what I was sent. Unfortunately that didn't work out.
What I need now is for someone to walk me through the steps in creating the form and subform to achieve the desired result.
I presume that I will need to create a query in order to use the Full Name
"field", but should that query be based on fields only from my Authors table, or do I need to use one or both of the fields from the junction table (Books_Authors)? I am also confused about the various settings for the combo box.
Can anyone help, please?
Thanks in advance
Robert
I am a beginner using Access 2007 to try to develop a small home library application to store details of my book collection. So far I have three tables as follows:
Table 1 Books has fields Book_ID (AutoNumber, Primary Key) and Title.
Table 2 Authors has fields Author_ID (AutoNumber, Primary Key), First_Name and Last_Name.
(These will be extended to include details like Publisher, fiction or non-fiction etc when I get my basic structure right.)
Table 3 Books_Authors with fields Book_ID and Author_ID (both Number fields and both Primary Keys).
This third table (I think it is called a junction table) is there to enable a many-to-many relationship between Books and Authors, as one author can have several books and one book may have several authors. I have created a one-to-many relationship between Books and Books_Authors on the Book_ID field, and a similar one-to-many relationship between Authors and Books_Authors on the Author_ID field.
I have developed a data entry form based on my Books table which allows me to enter a book title and then go to a subform to enter author details for that book. That works fine. But because I have several books by the same author I don't want to have to enter the author details every time. Instead when I get to the Author subform I would like to be able to use a lookup table in a Combo box, (based on my Authors table) using the author's full name { [First_Name] & " " & [Last_Name]} so that I can just click on the author I want. If the author I want is not on the list already I will use a button on the form to take me to another form to enter a new author. That part is OK.
I was sent a sample database which was very similar to the one I want and it worked OK. However when I tried to replicate it, by building it up from scratch, I was unable to achieve the same result. As I am trying to learn about Access I don't want to just copy someone else's database, although I thought at the time that I would be able to re-create what I was sent. Unfortunately that didn't work out.
What I need now is for someone to walk me through the steps in creating the form and subform to achieve the desired result.
I presume that I will need to create a query in order to use the Full Name
"field", but should that query be based on fields only from my Authors table, or do I need to use one or both of the fields from the junction table (Books_Authors)? I am also confused about the various settings for the combo box.
Can anyone help, please?
Thanks in advance
Robert