Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    223

    Red face Unanswered: How to populate a Form with data from different Tables

    Please could someone suggest what is the easiest way to populate a Form with data from different Tables?

    In my relationships, the main Table is CONTRACT which is linked to the following Tables:-
    OWNER
    PROPERTY
    RENTER
    RENTAL INCOME

    There is a ComboBox on my RENTAL INCOME FORM to choose a Contract ID.
    When the Contract ID is chosen, I want the RENTAL INCOME FORM to automatically show the following information:-

    CONTRACT TABLE (start date, end date, rental amount)
    OWNER TABLE (owner ID, owner name, address, phone number)
    PROPERTY (property ID, address etc)
    RENTER (renter ID, name, phone number)
    What would you attempt to do if you knew you would not fail?

  2. #2
    Join Date
    Nov 2009
    Posts
    223
    I have managed to include the data in a Sub Form. But how would i do thi if I just created new Text Boxes for the data (I would need about 15 text boxes)

    Example:-

    If ContractID = 15

    then I need to link this to the Renter ID (I do have Relationship links in my database) so I can show the Renter Name, Address, Phone Number etc etc.

    ???
    What would you attempt to do if you knew you would not fail?

  3. #3
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    You would need to write code that was triggered by the combo box to obtain the data for the controls (either via DLookups or recordsets) and populate them.

    Subforms are quicker, cleaner and easier, most of the time.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

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