'Forwarding' fields from one form to another

P

Phil Hood

I've just started using access so forgive this really
basic question :)

I am trying to create a database that has 1 main table and
4 other tables (and forms for each).

When I enter information into the first form (for the main
table), I am setting up command buttons that open the
other four forms (for the other tables) in order to add
additional information.

But, I want to 'carry forward' the basic information from
the main form/table into the other forms/tables so that
when the other four forms are displayed, they already
contain the info from the main form. Further, when I save
the data added through any of the other four forms, I want
to include the shared fields from the main form (e.g. the
primary key in the main table is a foreign key in the
other four tables amd I don't want to key it in again).

Does this make sense?

I hope so and I hope you can help.

Thanks (in hope)

Phil.
 
T

Turner

Phil; there are several ways that work. However, I like
this one. On the "On Activate" event of the form that is
being opened place code that looks something like this:

me.ControlThatYouWishtoPopulate _
= Forms!TheFormthatDidtheOpening!ControlThatHasTheInfo

Hope this Helps!
 
J

John Vinson

I've just started using access so forgive this really
basic question :)

I am trying to create a database that has 1 main table and
4 other tables (and forms for each).

When I enter information into the first form (for the main
table), I am setting up command buttons that open the
other four forms (for the other tables) in order to add
additional information.

Well... DON'T store the information redundantly in the related tables.

By far the simplest way to do this, usually, is to make the related
tables' forms Subforms on the main table. You can (for instance) put a
Tab Control on the form, and put a subform on each tab page. This will
let you see the "main table" data on the form in conjunction with each
related table's data in the subforms; the related tables would have a
foreign key linking them to the main table, and this field would be
used as the master/child link field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top