Referencing fields in subform from main form

MadCat

Registered User.
Local time
Today, 05:57
Joined
Jun 24, 2003
Messages
62
Hi all.

I have a problem to do with getting values from a field in a subform and copying the values to a field in the main form that contains the subform. In my subform i have a field in the footer which counts all the records. I'd like to be able to get this value into an unbound text box on the main form but i cannot get it to work. Each time i try to get the value, the text box on the main form has #Name? displayed in it. I have searched the forums and found some stuff on this but nothing that tells me how to get round this problem.

Any help would be much appreciated.
Thanks in advance
 
Thanks for the quick reply. Thats not working either. I'm still getting the #NAME? in the text box on the main form. I assume what you posted was to be put into the control source of the unbound textbox.

Cheers
 
Hi indesisiv

ok i've looked at the document you posted. It all makes sense. As far as i can make out thats what i'm doing and still getting #NAME? showing up.

in the unbound text box on the main form i have (under the control source):
=[Forms]![SitesByVersion_subfrm]![Count_txt]

where SitesByVersion_subfrm is the subform on the mainform and count_txt is the text box in the sub from that counts the records. i just used te expression builder. Would it be better to use VB code.

Thanks
 
=[Forms]![SitesByVersion_subfrm].form![Count_txt]
 
if i put that in i still get the #name? coming up in the unbound text box on the main form. I'm now utterly convinced that i'm doing something stupid somewhere.
 
Sorry .. just noticed the way you are doing it ...


=[Forms]![MAINFORMNAME]![SitesByVersion_subfrm].form![Count_txt]

should do the trick.
 
:D

Thank you. thats worked this time. Just need to get a wee work around for the #Error? that comes up when the subform is empty. That shouldn't be to bad, think i have a solution to that.

Thanks for your time.

When you said that you seen how i was doing the forms, is there maybe a better way? and thats why you posted what you did originally.
 

Users who are viewing this thread

Back
Top Bottom