Results 1 to 3 of 3
  1. #1
    jreanier is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Posts
    1

    Form (Table 1) with Subform (Table 2) not updating records in either table

    I am a NEW, NEW access user. I have created two databases that have some common fields. I've created a form using the Form Wizard to input data into Table 1. I then created a Subform so that the same information would update Table 2. This is not happening, and I'm desperate to know why. I really need a basic explanation. If it's too complex my brain will fizzle. I've been working on this for 2 weeks. Thanks!

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    It is not going to happen automatically, you have to tell it to update the other table. In the AfterUpdate event of your main form, run an update query that updates table 2. The subform is just a place to show data, it seems unneccessary in this instance.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    Table 1 must have a unique key field - autonumber
    Table 2 must have its own unique key field - autonumber - plus - a field to hold Table 1's value as a number field (let's call this 'T1Key')

    When you insert a sub form into the main form - the wizard will pre select the linking field and/or allow you to determine it

    Table 2 should not hold duplicate data that exists in table 1, and as you've discovered that data also does not automatically get written - with the exception of T1Key which does get automatically written into table 2.

    Relational database conceptually does not repeat the same data in multiple places. You use the link between the key fields of the 2 tables to display the data of Table 1 along with Table 2 information whenever it is needed.

    There are valid cases where you want to write the data of Table 1 into Table 2 - for instance Tax Rate - - as the tax rate changes across time you don't want to rely on a link as it would change past sales info....so in this case one must literally write code that will write the value of one table into another table and that syntax and trigger all depends on the how the user interface is designed.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-08-2015, 01:02 PM
  2. Replies: 12
    Last Post: 11-11-2014, 02:10 PM
  3. Updating main table from temp table AND form value
    By shabbaranks in forum Programming
    Replies: 8
    Last Post: 05-01-2013, 07:18 AM
  4. Replies: 3
    Last Post: 11-04-2012, 09:25 AM
  5. Replies: 2
    Last Post: 08-01-2011, 11:35 PM

Tags for this Thread

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