Referencing a fields from a form, from within a subform

MrSpoon

New member
Local time
Today, 00:44
Joined
Oct 5, 2010
Messages
3
I know that title is a bit of a tongue twister but what I am trying to do is...

I have a form, Called frmSample
and a subform called MthData

I have a field in the frmSample called txtKPI_Target

and I have a field in the Subform called txtKPI which I want to be populated by the above field from the main form. I've tried all I can think of - surely this should be simple enough ?

Thanks,
Danny.
 
Howzit

Check this out or referencing form controls.

Also if these two fields are bound fields in the underlying tables, you can specify the link (tell access which fileds in the main and subform tables are linked) in the subform properties so that it is automatically populated.
 
Thanks for the quick reply....

So I have set the Control Source of the text field (of the field I want populated) to be me.Sample!txtKPI_Target

But When I test this I just get "#Name?"

The form is linked to the subform through a one to many link. If I could utilize this link it may be best - but I am unsure of what to do...

Thanks

Danny.
 
Howzit

What field are you linking it on? You can link on multiple fields.

On your subform control properties go to the Data tab and click on the Link Master Fields elipses button. In here you specify the fields that are related in the main and subform tables. It is these and any defaults thate are automatically populated. You will need to add the fields in both tables relating to the txtKPI_Target control.

The control source on teh subform would need to be the field in the underlying table - not me.txt...

Remember to take a back up first.
 

Users who are viewing this thread

Back
Top Bottom