Linked Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database containing two tables which are related through the Staff
ID number.

The first table Staff information is related with a 1:* relationship to the
bookings table.

I.e. one member of staff can book many courses.

I have created the forms based on these tables using the wizard provided in
Access 2003. Mid-way through the Wizard I used the option to LINK the forms.

When you open the Staff Information form you have a button which says
"Bookings". When you access the bookings form you are provided with a
listing of the courses the staff have booked onto.

My problem is that if I add any records to this bookings table they are
added; but to an incorrect staff record i.e. not the filtered record from the
staff Information table. How do I get added bookings to 1) Be retained 2) Be
retained within the filtered record already selected?

Please HELP!

Thanks for reading and sorry if this all seems a bit vague - not great with
terminology x
 
Sarah_Lecturer said:
I have a database containing two tables which are related through the Staff
ID number.

The first table Staff information is related with a 1:* relationship to the
bookings table.

I.e. one member of staff can book many courses.

I have created the forms based on these tables using the wizard provided in
Access 2003. Mid-way through the Wizard I used the option to LINK the forms.

When you open the Staff Information form you have a button which says
"Bookings". When you access the bookings form you are provided with a
listing of the courses the staff have booked onto.

My problem is that if I add any records to this bookings table they are
added; but to an incorrect staff record i.e. not the filtered record from the
staff Information table. How do I get added bookings to 1) Be retained 2) Be
retained within the filtered record already selected?

Please HELP!

Thanks for reading and sorry if this all seems a bit vague - not great with
terminology x

The wizard is using incorrect terminology. Forms are only "linked" when one
form is a subform embedded inside of another. Your present bookings form is
nothing more than a form opened with a filter applied. This will do nothing to
control NEW records. All it does is filter for a desired set of existing ones.

If the only time your bookings form is opened is when the Staff form is also
open then you can set the DefaultValue property for the controls on the second
form to references that exist on the first form.

=Forms!Staff!ControlName

Personally if I want the behavior that is produced by a subform then I use a
subform. Even if real estate is tight on your staff form you could add a
TabControl and have the staff controls on one page a bookings subform on the
second page. Then all of this is automatically done by setting the appropriate
field names into the MasterLink and ChildLink properties of the subform control.
 
Back
Top