Originally posted by Noops
I have a table that I'd like to base a form on.
I'd like the form to have a subform and have both form/subform viewed in *datasheet* view.
The form would list the records from the table (in datasheet view) and when a record would be entered in the form, the subform would pull up all related records (related by NameID).
Guidance on how to set this up would be much appreciated!
Use an unbound form (a new form but don't attach a table to it). Place two subform objects on it. One with your Parent table(PT) as the Source Object and the other with the dependent table (DT) as the Source Object. In the property list for the dependent table property, name the tables key field or linking field (NameID) in the Link Child Fields property. In the Link Master Fields name the Parent table subform object, bang, and corresponding field (PT!NameID). The dependent table subform then needs to be requeryed. Use a command button (on click me!DT.requery)
I am not sure how the dependent table knows that there are cooresponding records before the parent table record is created. (You said "when the record would be entered in the form"). Is there are a third/Master table ?
> I am not sure how the dependent table knows that there are cooresponding records before the parent table record is created. (You said "when the record would be entered in the form"). Is there are a third/Master table ?
I have several tables but the main ones are a Detentions table, User table and Student table. The main form would be the conduit to enter new records in the detentions table. The first control in the main form would pull up all matching (studentID) detention records in the subform.
Both form and subform would look essentially the same in design (same as the Detentions table).