Subform requeries main

C

CJ

Hi:

I have a subform (in datasheet view) that contains a list of values that are
totalled (individually) in some Summary queries. The Total values from the
individual summary queries are part of my main form in text boxes

I am unable to make a change in the subform update the totals in the query
and therefore the totals in the main form.

My subform (fsubCostTypes) has data like:

Record 1: Survey 1000
Record 2: Drafting 2000
Record 3: Survey 1500

I have a qtotSurveyTotal and a qtotDraftingTotal that calculate the totals
for each cost type.

My main form (frmDevelopment) should show:

Survey 2500
Drafting 2000

If I change the first Survey record to be 5000 then the total on the main
should change to 6500.

Can anybody solve this for me?

Thanks in advance.
 
P

Pat Hartman

In the AfterUpdate event of the subform, you need to have the mainform
recalculate the fields that reference the subform. Try:
Me.Parent.SomeField.Recalc

If .Recalc doesn't work, try .Requery
 
C

CJ

Thanks Pat.

That's what I was working on but it looks like my syntax was out of whack
and Access was not being very helpful in straightening it out for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top