referencing a unbound calc txt box from sub1 to main

Flynners

Registered User.
Local time
Today, 11:24
Joined
Mar 1, 2012
Messages
29
Hi
I have:
1 main form called frmMain
1 subform called frmScore
1 unbound text box called txtcountScore in footer of subform txtcountscore =count(*) to count records entered in subform
1 unbound text box on frmMain called txtchkTotal

I want to reference this count in the main form so that when command button is clicked at later stage, an error message would appear if the count does not match another field called Total Received

I want to pass the total number of records in my subform into txtchkTotal on my frmMain

Ive tried many different variations as control of txtchkTotal to lookup the Count on my subform
=[frmScore]![txtCountScore]
=[me]![frmScore].[Form]![txtcountscore]

but no matter what variation of syntax i use, I get #Name. in my text box on frmMain
Is this because the field i am looking up is unbound/calc field or is it incorrect syntax?

is there a better way of doing this?
thanks
 
In the Control Source property of txtchkTotal, click on the ellipses. This will open the expression builder. Navigate to txtcountscore in your subform, click Paste and then Ok. And your syntax would be correct.
 
thanks, no luck Im afraid.
I tried that when I doubted my own syntax and since your post Ive tried it again
I get
=[Forms]![frmScore]![txtCountScore]
using the ellipses but when i view the form I still see #Name in the text box on frmMain, when I can see data in the txtCountScore text box on the subform.

Thats why I was wondering has it anything to do with unbound or calculation as I have used this syntax in other places to bound controls and it works nicely.
 
=[Forms]![frmScore]![txtCountScore]? How ?

You are supposed to navigate to the txtbox on the subform (via OPEN forms in the Expression Builder and then the subform) whose value you want.
 
ah I was navigating to all forms, and selecting my subform in the form list, rather than selecting it from within the loaded forms

sorted now, thanks very much for you help
 

Users who are viewing this thread

Back
Top Bottom