Results 1 to 3 of 3
  1. #1
    triveson is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    2

    Data from child text box not saving to table

    I have two tables one holding client details and one called data for the main functionality of the darabase.

    They both have a short text primary key field and these are linked one to one - as I only want one record per client in the data table.

    It is not an auto number as I wish to use the client code from my accounts package.



    When adding a client I have a form which has all the fields related to this table. It also contains a sub form linked to the data table and containing a text box with the control source of the primary key field. This is also the child field to the parent field - the client id on the main form

    At present when the code is added to the master field it is replicated in the child field as desired. Ie I have linked the records using a unique identifier.

    However although this adds data to the client table the child field does not create a new record in the data table. I want it to so that this can be queried out elsewhere and further data added.

    How can I get the closing of the form using a button to not only save the new client record from the fields on the main form but also save the data in the sub form child field to the underlying other table? Note the subform is bound to the data table

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I think this is a post where a picture or 2 and showing any code you have may be better than words.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    I agree with orange...I've read your post numerous times and can't really follow it (also probably why four dozen members have read it and only two of us have responded)...a clearer explanation is really needed...but here's a couple of things.

    If the Subform is Bound to a Table...when you exit it, any Bound Fields will automatically be saved...with no action needed, on your part.

    If this isn't happening, then either your Field isn't be Bound, or (and going by the line "does not create a new record in the data table") I suspect that you're not adding any other data to the Subform...hence it's not dirtied; adding data to a Record thru code only does not dirty the Form) and not being dirtied, no Record is there to be Saved!

    I have to tell you, having a Subform that will only ever contain one Record, i.e. in a one-to-one relationship, is generally bad design! You don't need this is order to Query it out later, when the same data is available in the Table the Main Form is based on.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 1
    Last Post: 08-06-2016, 10:39 AM
  2. data not generating in child table.
    By Tommo in forum Database Design
    Replies: 10
    Last Post: 09-03-2015, 07:40 PM
  3. Replies: 12
    Last Post: 12-31-2014, 09:30 AM
  4. Replies: 5
    Last Post: 07-26-2012, 07:53 AM
  5. Pulling most recent data from child table
    By davidv43 in forum Access
    Replies: 0
    Last Post: 02-07-2009, 11:36 AM

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