|
-
Jan 23rd, 2006, 09:04 AM
#1
Thread Starter
New Member
Access and forms
Hello all.
I'm trying to do simple database for keeping record of books and in process trying to learn how to use Access
My db has only three talbes Authors, Books and association table BooksAuthors. http://i1.tinypic.com/mhdrtz.jpg <- connections
Main problem for me seems to be how to make a form that shows book and all it's authors. http://i1.tinypic.com/mhecuv.jpg <- example
Form is made by wizard and it's just bound to Books table.
I would like to use listbox for showing the author or authors of book. The Listbox has a query as a rowsource with following sql:
VB Code:
SELECT Authors.AuthorID, Authors.Lastname+", "+Authors.Firstname AS Name FROM Authors INNER JOIN BooksAuthors ON Authors.AuthorID = BooksAuthors.AuthorID WHERE (((BooksAuthors.BookID)=[I Need to get BookID from the form]));
I need help to understand how to pass BookID from the form to the query that populates listbox.
ps. This is my first post on the forum and my hands are still shaking.
pss. Hope you understand my english.
-
Jan 23rd, 2006, 10:39 AM
#2
Re: Access and forms
LOM
You need to passs the value of the TextBox that contains the BookID to the WHERE clause of your select statement.
Changing
VB Code:
WHERE (((BooksAuthors.BookID)=[I Need to get BookID from the form]));
to
VB Code:
WHERE BooksAuthors.BookID=" & Me.TextBox1.value
you will need to change TextBox1 to the name of your Textbox that holds the BookID
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Jan 23rd, 2006, 11:49 AM
#3
Thread Starter
New Member
Re: Access and forms
That solved it
Thank you DKenny
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|