Form opens and takes first values from table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SCarpenter

    #1

    Form opens and takes first values from table

    Hi,

    I have a subform that opens from a main form via a command button. The main form fields are populated based on a series of queries, ultimately based on tables. The subform is populated from and bound to a separate table.

    On the main form, the fields are blank, however when opening the subform via the first record on the main form, the fields in the subform are populated with the first values on its dedicated table, albeit the ID (Primary Key) is the record it ought to be (as defined by the record on the main form). I would like it to remain blank if there is no data for that ID, rather than stealing the first available data from another record!

    I've done numerous Google searches to figure out what's wrong but as yet have had no luck. Any help would therefore be greatly appreciated.

    Thanks
    Sarah
  • dsatino
    Contributor
    • May 2010
    • 393

    #2
    Are your parent/child attributes set correctly?

    Comment

    • SCarpenter

      #3
      Think it's sorted

      Thanks for the suggestion. I wasn't sure how to change the parent-child attributes, so some more Google searching was required. In the process, it got me to revisit and really look at the table/s involved, and I've now changed the Required property on the fields that aren't the Primary Key to 'Yes', which seems to have sorted it (in any case, I'm going through the various ways it screwed up before and I can't make it do it again, so hopefully that's solved it).
      Cheers.

      Comment

      Working...