Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subforms

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
I have a form and subform that I use to keep track of stock holdings. The subform includes buys, sells, Dividends and commissions. It includes a calculated field From a query) that gives a total of each transaction. The Subform links to the main form on the stock symbol. I have put in formulaes in the subform fooer to calculate the total spent or earned on any holding. I calculate loss or gain (Current Market Value less investment) on the Main form.
In the subform footer, I have a non-bound field [SumTtlCst] with the formula:
=Sum(Total/Cst].
In the main form, I try to copy the amount from the subfooter with a non-bound control [txtTotal Cost]] with the formula:
=[StkSub Queryfrm].[Form]![SumTtlCst]
The subform is called [StkSub Queryfrm].

Some times, this works, but at other times,I will get a blank or #Name in the text box.
I'm not sure what I am doing wrong. . I have tried on-line help and all of the suggestions on this forum that I have been able to find.

Any help would be greatly appreciated!!
 
I figured out my mistake. Took looking at every post and forum for ages!
The text box of a calculated form must not have the same name as the underlying field in the table. I don't know why but sometimes it will work but not at other times. I have seen many old posts where people were having this issue. However, this was never mentioned.

Hopefully, this will help others in the future!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top