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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!

Status
Not open for further replies.

quinny1

Programmer
Oct 17, 2000
12
GB
Hi Everyone,
I wonder if you can help. I have a form with a subform on it which contains several fields. The sub form is based on a table called "Works" which can have several records for each one record on the main form. The problem is I need several fields on the main form displaying the totals of all the associated records on the sub form.I.E. A field "TOTAL OF ACTUALS" on the main form would display the sum of the "ACTUAL" field related to the record on the main form. I tried assigning a query based on the table "WORKS" to the controlsource of a text box but can't get it to work. Could anyone help?

TIA

Quinny
 
Yes forget bound forms and subforms!

Create an unbound form with controls for each record of the main table. Then place a large listcontrol underneat that which is based upon a query that will return the subform results you were needing. Bound controls in Access SUCKO!
 
Hi everyone
I have a main form , “House ” containing a subform ,”works”.The main form has a one to many relationship with the sub form.
How can I display a total on a mainform which is the sum of a field ,”estimate”, on the subform which corresponds to the id field on on the main form.I.E. The result of “SELECT DISTINCTROW Sum(Works.Estimate) AS SumOfEstimate FROM Works WHERE HOUSE.HOUSEID = WORKS.HOUSEID”
I tried an unbound textbox on the house form and set the controlsource to the above query but it doesn’t work. Sameal suggested using unbound forms but is this the only way?
Thanks in anticipation.

quinny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top