Results 1 to 7 of 7
  1. #1
    Jonpro03 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    13

    Form pulls info from 2 tables.

    I am working for a small literacy program and working to create and maintain a database for the library of books and other materials they lend.

    I created a database using an excel spreadsheet that they had been maintaining and created a form called Lending Library to pull, modify, save, delete, and create records.

    Previously, the name of the individual who checked out the material was manually typed in. I've been asked if I can add phone numbers to the form. I have a separate database of every person associated with the company with phone numbers and email addresses. I imported that (excel) spreadsheet to a table called Contacts.

    So now I have two database tables, one called Contacts, one called Materials, and one form called Lending Library.

    The Lending Library form currently has a combo box which is used to select records from the Materials table. I tried adding a second combo box to the form that gets values from the Contacts table and it works. It shows the name and phone number, but only in the combo box. I would like to have the ability to select a contact from that combo box and have it fill in a couple of text boxes on the form.

    I hope this is not too confusing and I hope you can help me. I'm using Access 2010 on Windows XP 32.

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Perhaps this tutorial will guide you to your solution

    http://www.datapigtechnologies.com/f...tomfilter.html

    Alan

  3. #3
    Jonpro03 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    13
    Sadly, that wasn't as helpful as I had hoped. I already have a combo box that can select a record from the Materials table. How can I add another combo box that will select records from the Contacts table and add that information to the same form. Also it needs to append the selected contact to the selected Material so that when the record is pulled up later, we can see the contact that checked out the material.

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Perhaps, if you posted a shortened (sanitized) copy of your db, it might be easier to understand what you are attempting to do. Be sure to run a compact and repair before you post your db as that will reduce the size. It is difficult to understand without seeing the data structure of your tables and forms.

  5. #5
    Jonpro03 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    13
    I can do that, give me a moment to prepare it.

  6. #6
    Jonpro03 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    13
    I managed to achieve my goal in a round-about way. I have a combobox that pulls records from the Contacts table and saves the ID to a new cell I created on the Materials database. I labled that cell CheckoutID. I then joined CheckoutID on the Materials table to ID of the Contacts table using the relationships page.

    Then I was able to create a subform with the Master field linked to the CheckoutID I created. The Child field is linked to the ID of the contacts table. Then the only thing left was to have the subform update whenever a new contact was selected form the combobox. So I edited the properties of that combobox, slected Event - On Change and added the following code
    Code:
    [Contact subform].Requery
    I tried to upload the database but I cannot get the filesize under 500kb :/
    Here's a screenshot to give you an idea of what I did.

  7. #7
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Glad to hear that you solve it. As to the size, did you try to run a compact and repair before uploading. When developing an Access db, it is good to do this often as when you make changes, Access does not reduce the size if you delete items, fields, tables, etc. The C&R does this.

    Alan

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report that Pulls from two Forms - Lending Library
    By Surferboy1500 in forum Access
    Replies: 8
    Last Post: 06-07-2011, 12:13 PM
  2. Replies: 3
    Last Post: 01-31-2011, 11:47 AM
  3. Replies: 1
    Last Post: 12-13-2010, 04:06 PM
  4. Getting Info From Tables with Queries
    By SteveI in forum Queries
    Replies: 0
    Last Post: 03-01-2010, 08:33 AM
  5. Replies: 1
    Last Post: 02-13-2010, 12:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums