Results 1 to 3 of 3

Thread: Access and forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    2

    Smile 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:
    1. 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.

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    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:
    1. WHERE (((BooksAuthors.BookID)=[I Need to get BookID from the form]));
    to
    VB Code:
    1. 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

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    2

    Thumbs up 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
  •  



Click Here to Expand Forum to Full Width