Results 1 to 3 of 3
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318

    Auto Populating using multiple tables.


    In the attached database I have a donation form that I want to be able to enter the first and last name and donation information but I get a need for a primary key error which I am assuming is the D_Code. I did a Me! after update code off of the first name combo box to populate the D_Code but am getting a error that it can't be populated. I am assuming that it is because it is from a different table. Can you please tell me how I can accomplish what I am trying to do?
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    You have not defined primary key field in Tbl_Contacts. C_Code is a poor unique identifier. What if you have more than one Jane Smith? Should set ID as primary key.

    Forms can do data entry/edit for only one table. The form RecordSource should not include Tbl_Contacts.

    Should not have two comboboxes for selecting contact, should be one combobox and should not be bound to fields from Tbl_Contacts. Set combobox properties:

    ControlSource: need a number field in Tbl_Donations for saving Tbl_Contacts ID
    RowSource: SELECT ID, C_Last_Name & ", " & C_First_Name AS FullName FROM Tbl_Contacts ORDER BY C_Last_Name, C_First_Name;
    BoundColumn: 0
    ColumnCount: 2
    ColumnWidths: 0";2.0"

    Alternative is a form/subform arrangement. Main form bound to Tbl_Contacts and subform bound to Tbl_Donations - no combobox needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    Looks like the subform idea works best for me. Thanks.

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

Similar Threads

  1. Auto populating on a Form
    By Canadiangal in forum Forms
    Replies: 1
    Last Post: 03-28-2013, 04:54 PM
  2. Populating ID in multiple tables
    By Dega in forum Database Design
    Replies: 18
    Last Post: 11-22-2011, 07:32 AM
  3. Auto Populating a new form
    By mikejames in forum Access
    Replies: 12
    Last Post: 09-25-2011, 11:41 AM
  4. Replies: 1
    Last Post: 08-02-2011, 06:23 AM
  5. new guy with a question on auto populating
    By zdiver07 in forum Forms
    Replies: 2
    Last Post: 05-03-2010, 11:06 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