Results 1 to 8 of 8
  1. #1
    Davetartblog is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    NC
    Posts
    7

    Automate record entry on Subform

    I have a form with various fields bound to a table called {AuditData}. One field in particular is [SerialNo]. I have a subform (bound to table {AuditDetail}) on this particular form where there is a child field called [SerialNo] as well. The subform field populates when [SerialNo] is entered on the main form. The problem that I'm having is that it IS NOT creating a new record in the table {AuditDetail}. The only other field on the subform is one with a default value which is obviously already populated. When I save the record, {AuditData} shows the new record based on the values of the form, but {AuditDetail} has no entry at all. I'm missing something. Both the main form and the subform are set to Data Entry and to allow additions/edits. I don't know where to look next.

  2. #2
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    The subform field populates when SerialNo is entered on the main form.
    This means that the child table has record(s) related to the parent table.
    The problem that I'm having is that it IS NOT creating a new record in the table {AuditDetail}.
    You have to enter data in the subform for it to update its source table.
    The only other field on the subform is one with a default value which is obviously already populated.
    What is the use of having such a subform which contains just the foreign key and a default value?
    When I save the record, {AuditData} shows the new record based on the values of the form, but {AuditDetail} has no entry at all.
    Are there more fields in the source table? What exactly do you want to save?
    I'm missing something.
    Of course you are; how many child records for each parent record can you save with just those two fields in the subform?

  3. #3
    Davetartblog is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    NC
    Posts
    7
    Quote Originally Posted by goodguy View Post
    This means that the child table has record(s) related to the parent table.
    This is a data entry form. There are no related records in the child table for a record that is just being added. If a record is being added when I update the parent form, then...

    Quote Originally Posted by goodguy View Post
    You have to enter data in the subform for it to update its source table.
    ...doesn't make much sense.

    Quote Originally Posted by goodguy View Post
    What is the use of having such a subform which contains just the foreign key and a default value?

    Are there more fields in the source table? What exactly do you want to save?
    The use of having the subform is for these particular records. The records being entered are production units that have been inspected and no defects were found. There is another form for entering units that have one or more defects. All units (AuditData) have at least one accompanying record in (AuditDetail) specifying either the defect or "none", which is the aforementioned default value in the form. Other fields in the source table are related to the defect found and corrective action taken and thus wouldn't be populated in the absence of a defect. I'm wanting to save the record that shows up on my subform. It is populating, but not saving to the underlying table.

  4. #4
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    Check if your Master Field / Child Field are set correctly.
    Select the subform in design view, display Porperties Pane, click on Data tab.

  5. #5
    Davetartblog is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    NC
    Posts
    7
    They are correct correct to the extent that I can see. With the current settings, adding data to the parent does cause data to show up in the child. The issue remains that unless I specifically type data in the subform, a new record isn't created or saved despite any updates to the fields by the parent form.

  6. #6
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    Please explain how a new record is created without your typing anything in the subform?

  7. #7
    Davetartblog is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    NC
    Posts
    7
    When I enter data in the parent form (in this case, a serial number) and switch the focus to the next control, the value of the field on my child form updates whereas it was blank before. This doesn't seem to be starting the process of creating a new record as the supposed-to-be-hidden PK on the subform doesn't show the next record number, but rather still shows (AutoNumber). (I unhid the control to see what was going on.)

  8. #8
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    Curiouser and curiouser! In all my computing experience, a new record in a subform is only created by the user keying in data. Automatic creation is something I have not yet seen tried anywhere.

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

Similar Threads

  1. Replies: 7
    Last Post: 07-15-2011, 01:58 PM
  2. Data Entry in SUBFORM
    By flsticks in forum Access
    Replies: 1
    Last Post: 04-03-2011, 08:07 AM
  3. Validating mutiple entry in a subform
    By Grooz13 in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 06:53 AM
  4. Entry into subform
    By lynchoftawa in forum Forms
    Replies: 1
    Last Post: 06-17-2009, 09:28 AM
  5. Subform Data Entry Issue
    By yuriyl in forum Forms
    Replies: 3
    Last Post: 05-14-2009, 08:49 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