link subform?

  • Thread starter Thread starter Shivalee Gupta via AccessMonster.com
  • Start date Start date
S

Shivalee Gupta via AccessMonster.com

i have a form which shows name. i want a subform below it which shows me
his/her marks in a particular subject. if the name changes(it can be a
combo box), then his marks should also change.
how do i link my name with the subform?
please help!
 
In order to link a subform with a main form you need a common field between
the two forms. For instance, the main form should have a primary key (unique
value, never repeated) that also appears in the table behind the subform
(can be repeated). Thus if your subform is marks for a particular subject,
then the table which records this info must have the same primary key field
that your main form has, which actually becomes the 'foreign key'. This
links say students to the grades they received.

Once this relationship has been established you can create the relationship
between the two tables involved in the relationship window, a icon on the
menu bar of Access. If you are not familiar with this concept, I would
recommend reading up on the subject before trying to establish this in your
database. Access is the one Office application where learning how to use it
properly has a steeper overall learning curve than any other Office
application. If you ignore crucial subjects to learn such as, Referential
Integrity, Normalization, Relationships, you will create an unusable
database that is hard to maintain.
 
i have done all. create 2 tables. one is primary key and the other is
foreign. i have linked them using relationships(also estableshed cascading
facilities). i am aware of all dbms and rdbms fundamentals.
all i am asking for is a linked subform! can u please provide code to me? i
am also using wizard but not getting required results.
thanks
 
i have a form which shows name. i want a subform below it which shows me
his/her marks in a particular subject. if the name changes(it can be a
combo box), then his marks should also change.
how do i link my name with the subform?
please help!

Simply set the Master Link Field property of the Subform control to
the name of the combo box (this isn't an option that the wizard gives
you but you can type it in); the combo box's bound column should be
the unique StudentID. Use the StudentID as the Child Link Field.

John W. Vinson[MVP]
 
you are not only genius but also very helping. the code worked like a
charm. i wish more people were like you, who not only have knowledge, but
also share it!
thanks a zillion,
shivalee
 
Back
Top