Results 1 to 3 of 3
  1. #1
    intergnat1 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    1

    PLEASE HELP - Two tables populating one form

    Hi Everyone,



    I'm trying to have two text boxes in one form be populated by fields from two tables (field from table1 populate one textbox, field from table2 populate the other textbox). I've tried playing with "control source" for both and can only get one to populate correctly (I get "#Name?" in the other textbox when I type "[table2]![text2]").

    As I can only assign one "Record Source" for the Form, I don't see how I can get around this problem and I don't know the access syntax well enough to properly research my issue I feel like this should be such an easy fix but I simply cannot find the solution. Can somebody please hold my hand a bit on this? Thanks!!!!!

  2. #2
    Stressed is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    19
    Do these tables have related fields?

    You can build a query with the information that you require then use that query as the record source.

  3. #3
    MuskokaMad is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Posts
    17
    A little more detail would be helpful but in general.

    1. Usually Tables contain many records so the two tables need to be related so that the form knows which record to look for in each table.
    2. If the tables are related you can use a DLookup for the control source.

    Syntax = DLookup("FieldName","TableName",Conditions)

    eg. = DLookup("FirstName","tblCustomers","ID =" & Customer_ID)

    In the above example the code will return the contents of the FirstName field in the Customer Table where the Primary Key ID is the same as the foreign key Customer_ID on the Parent Table.

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

Similar Threads

  1. Populating Fields
    By deiniolj in forum Forms
    Replies: 21
    Last Post: 12-08-2009, 10:51 AM
  2. Self Populating Fields
    By kellyd in forum Access
    Replies: 0
    Last Post: 09-17-2009, 10:20 AM
  3. Form data not populating in table
    By sabrown in forum Forms
    Replies: 0
    Last Post: 08-27-2009, 08:19 PM
  4. Self-populating one form from another
    By winter in forum Forms
    Replies: 7
    Last Post: 08-03-2009, 08:02 AM
  5. Replies: 9
    Last Post: 03-24-2009, 09:19 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