Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Unanswered: Subform synch/relationships problem

    Hi all,

    I have a subform problem...

    I have embedded a subform (detailsETC) into my "mother" form (demographics1).
    Each form is based on a table of the same name, and the tables are linked in a one-to-one relationship, with the demographics1 being the primary table (I want only one detailsETC entry per each demographics1 entry).

    However, when I look at the tables in datasheet view, it looks like it is embedded the other way round. i.e. each record in detailsETC table has a plus sign next to it, and expands to show the data from the demographics1 table (it looks like demographics1 is the daughter, even though it appears correctly as the mother form).

    The problem I'm having (aside from not understanding that), is that I want to tab all the way through the subform without it automatically creating a new record to continue data-entry. I thought that creating a one-to-one relationship between the tables would prevent the creation of more than one record in the subform, but this does not appear to be the case.

    Essentially, I enter data in the main form (5 fields), and on tabbing from the last field, it takes me to the first field of the (blank) subform, so that I can continue data entry for that record. Perfect. Then, if I complete data entry in the sub-form, but DONT press TAB in the last field, all is well. The form and subform appear to be synchronised (i.e. when I move between records using the mainform navbar, the subform data changes accordingly - I've already removed the sub-form navbar).

    The problem occurs if I press TAB in the last field of the subform. This action creates a new record from within the subform, while the record in the main form remains the same. Having removed the navbar, I thought I'd got around the problem until I started using TAB.

    I tried setting "Allow Additions" for the subform to "No", which does prevent new entries in existing records, but also stops the creation of new records (the subform is blank, showing no fields for data entry).

    I think there's maybe something obvious I'm missing, so I'd love to hear any suggestions.

    Thanks in advance,


  2. #2
    Join Date
    Jun 2004
    my view:
    even if the relationship is 1:1, it does not means that the subform cannot allow addition when the main form is still at the current record. the relationship only enforces the referential integrity of the records/fields between the 2 tables.

    when you 'tab' at the last field of the subform, it would allow new entry, and referential integrity will kick in only when you attempt to add a 'sub' record.

    Not sure if this can work, in your subform, at the "other' property, set cycle to 'current record', this way subform will not attempt to add new record when you 'tab' at the last field.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts