Results 1 to 6 of 6
  1. #1
    justair07 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Location
    Flordia
    Posts
    63

    One form to populate multiple tables

    Hello,

    I'm fairly new to Access and I'm having trouble using one form to populate all my tables at the same time. I would like for all of my tables to be identified as the same record by having the same primary key. For example: If I enter data on my form for one table but no data for another table I would still like the record to be the same.

    The issue I'm having is once I leave a part of the form blank the table is left blank as well and the record gets mixed up.

    I hope what I'm saying makes sense, it's hard to describe the issue.

    Please let me know if anyone knows what I'm doing wrong.

    Thank you,



    -Justair

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    Describe your database structure. What are the data entities and how do they relate? What is the database documenting?

    Essentially, use one form to edit/enter data to one table. Use form/subform arrangement to synchronize master/dependent records.
    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
    justair07 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Location
    Flordia
    Posts
    63
    I am not sure if I established the primary key and foreign keys correctly. My
    primary key is in a table called Header and is called ID. It is an auto number.
    The other four tables all contain the foreign key that are also called ID (auto
    number). My queiry runs great and the table populates as needed, with one huge
    exception. There will not always be data to enter in each table (except the
    Header table). So some parts of the form are left blank, leaving no data to
    populate some of the tables. Once the record is made the ID numbers no longer
    match up for all the tables left blank the ID does not change along with the
    other tables in which data is entered. So the record is no longer mantained all
    under the same ID number(primary and foreign keys).

    Is there anyway to
    lock each table so when a new record is made, regardless if data is entered or
    not on the form, it will all maintain the same ID number?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    Foreign key field cannot be autonumber.

    Use form/subforms arrangement for data entry/edit of master and dependent records. The subform container control Master/Child Links properties will manage the synchronization and automate saving the PK as FK into dependent records.
    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.

  5. #5
    justair07 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Location
    Flordia
    Posts
    63
    Ok, I guess I'm going to have to look up how to synchroize the forms. I've never heard of that. I created a form for each table. I then places all the forms in my Header form. Is that the right start?

    BTW, thank you for all the help

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    The subforms should be in Detail section so they will synchronize with each record on the main form. Also put main form data controls in the detail section.

    Form/subform is basic Access functionality. http://office.microsoft.com/en-us/ac...010098674.aspx
    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.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-14-2013, 09:35 PM
  2. Replies: 5
    Last Post: 12-21-2012, 11:05 PM
  3. Replies: 1
    Last Post: 10-28-2012, 07:23 PM
  4. Replies: 0
    Last Post: 02-13-2011, 02:55 PM
  5. Replies: 4
    Last Post: 01-20-2011, 10:05 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