Passing Data from a Main form to a Sub Form

G

Guest

Hi,

I have a Main form and a Sub form. The main form is connected to a table on
an SQL server.

I use a combo box to select the value on the from the main from - this
populates several fields on the main form.

Then I would like to Press an 'Add To' button which then copies some of the
fields on the main form to the Sub form (so the user can see the subform as
it builds) - I am using continous forms for the subforms.

So how do I create a new record in the subform, then copy field 1, 2 and 3
to the subform?

Any help is greatly appreciated.

Cheers.
GLT
 
B

Bob Quintal

Hi,

I have a Main form and a Sub form. The main form is connected to
a table on an SQL server.

I use a combo box to select the value on the from the main from -
this populates several fields on the main form.

Then I would like to Press an 'Add To' button which then copies
some of the fields on the main form to the Sub form (so the user
can see the subform as it builds) - I am using continous forms for
the subforms.

So how do I create a new record in the subform, then copy field 1,
2 and 3 to the subform?

Any help is greatly appreciated.

Cheers.
GLT
Relational database design says that you should have exactly ONE (1)
field in common between the tables linked in a form-subform
arrangement, and that is the one (1) field that relates the data.
This is handled automatically by the subform control when you set
the link parent fields and link child fields in the subform
control's properties.

(1) this assumes a single-field primary key on the parent table, if
you have a multi-field primary key, then the number of fields in
common is exaxtly the number of fields in the primary key.
 

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