Results 1 to 4 of 4
  1. #1
    Join Date
    May 2013
    Posts
    4

    Unanswered: Data Entry Form: Using a Combobox to Select Data from Multiple Tables

    I have two tables, Customers and Transactions.


    Customers has the following three columns:

    CustomerID LastName FirstName


    Transactions has the following three columns:

    TransactionID Amount CustomerID


    I have created a one to many relationship from Customers.CustomerID to Transactions.CustomerID.


    I would like to create a data entry form for the Transactions table. I want to use a combobox that selects a CustomerID for the Transaction table, but displayes FirstName and LastName from the Customers table.


    I have tried creating a query that includes Transaction.CustomerID, Customer.FirstName, and Customer.LastName and indicating that the Bound Column should be Transaction.CustomerID. I encountered two problems using this method:


    1. Each CustomerID in the Transaction table has multiple entries, so the combobox shows each name multiple times.

    2. The CustomerID is does not show up in the Transaction table.


    I appreciate any help!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    1. Set the RecordSource property of the form to: Transactions

    2. Set the following properties of the combo:
    - RowSourceType: Table/Query
    - RowSource: SELECT CustomerID, LastName, FirstName FROM Customers;
    - ControlSource: CustomerID
    Have a nice day!

  3. #3
    Join Date
    May 2013
    Posts
    4
    Thanks Sinndho! Everything is now working.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •