Linking forms & tables

  • Thread starter Thread starter william072
  • Start date Start date
W

william072

HI

Being pretty new to Access, can any one help with linking
a form and sub form. I have created a form that has basic
HR data and another form that has the training carried
out. The common unique link between the two is the
employee number. Although I can create a command button
to open the training form how do I get it to always link
it to the current employee I am viewing on the HR form.
Also is it possible to just display the training that
particular employee has taken and not show all the
training columns

Any assistance would be greatly appreciated
 
HI

Being pretty new to Access, can any one help with linking
a form and sub form. I have created a form that has basic
HR data and another form that has the training carried
out. The common unique link between the two is the
employee number. Although I can create a command button
to open the training form how do I get it to always link
it to the current employee I am viewing on the HR form.
Also is it possible to just display the training that
particular employee has taken and not show all the
training columns

Any assistance would be greatly appreciated

What you have is a popup form not a subform. The term "subform" refers to a
form that is embedded within another form using a subform control. This
control has two properties MasterLink and ChildLink that provide the "link"
you are seeking.

If you open a separate form outside the main form you can easily cause the
second form to open filtered to only show the records related to the main
form (this is one of the options for a command button in the wizard), but
this will not provide any automatic linking should you decide to add new
records to the second form.

If the second form will *only* be used in this manner (being called from the
other) then you can set the DefaultValue property for the common fields to
something like...

=Forms!NameOfMainForm!NameOfLinkedField

....and you will get the same effect as you would with a proper subform. If
you sometimes use the second form when the main form will not be open, then
you would have to leave the DefaultValue properties blank and assign them in
code when you open the form from the first one.
 
Back
Top