Design question - is subform the best approach?

  • Thread starter Thread starter Laurel
  • Start date Start date
L

Laurel

I have a form (could make it into a report if it would help), which looks
like this - continuous form. All the data is from the same table.

[tbl1.date] [tbl1.scores] [tbl1.comment
]
[tbl1.Comment
]

I would like to add a sub form which would display rows for that same date
from a different table. There might be none, one, or there might be many
rows in tbl2.

[tbl1.date] [tbl1.scores] [tbl1.comment
]
[tbl1.Comment
]
[tbl2.Description
]
[tbl2.Description
]
[tbl2.Description
]
 
Hi Laurel

A quick fix come to mind for this problem. You have a continous form with
data in fields (one of which is a date field).
You copy this form call it form2 or whatever. Make this new form a single
form with a datasheet subform.
Link form2 and the datasheet by the date field.

On form one you could have on click this code


DoCmd.OpenForm "Form2", acNormal, "",
"[DateField]=[Forms]![Form1]![DateField]", , acNormal
DoCmd.Close acForm, "Form1"

This would open form2 to the correct date and the data sheet would show any
relevent records.

OnClose of form2 would be
DoCmd.OpenForm "Form1", acNormal, "", "", , acNormal

This may be too simple but it would seem to be a simple method to get the
reslts you want. Have a go and then change it later.
 
Back
Top