Send Values to Sub-Form

T

TimT

Hello all!
I have a subform that's linked to the main form based on three fields.
The three fields are Company, Year, and Quarter.
The main form's data source is tbl_pbt and the subform's data source is
tbl_apportionment - they both have the three fields Company, Year, and
Quarter which is concatenated to form the PK and FK.
I would really like to be able to populate the three fields in tbl_pbt on
frm_pbt and have it autopopulate to tbl_apportionment on sbfrm_apportionment.

Can I do this with a "me.company = " type of command?
If so, what would the syntex look like?
 
C

Chris

I think the easiest way would be to set the subform's Master and Child Link
Fields to thosethree felds in the table (under general subform properties)

HTH

Chris
 
T

TimT

I did that already.
But the fields in the subform need to be populated to match the three of the
master fields.
Right now I have the same three combo boxes on the subform as the main form
and I have to manually populate them on both.
I just wanted to be able to have the three fields on the subform populate
with the same values as the ones on the maine form.
 
C

Chris

Setting the Master and Child fields should do just that. You may need to
refresh the subform manually (i.e. when you want to populate the values, call
<subformname>.Requery).
Alternatively, if you set the link fields correctly, you should not need the
same fields on the subform. I've always deleted them, and it worked just fine.

HTH

Chris
 
T

TimT

You are so right. Thanks.
I just noticed that.

Chris said:
Setting the Master and Child fields should do just that. You may need to
refresh the subform manually (i.e. when you want to populate the values, call
<subformname>.Requery).
Alternatively, if you set the link fields correctly, you should not need the
same fields on the subform. I've always deleted them, and it worked just fine.

HTH

Chris
 
Top