from sub form to main form

  • Thread starter Gaetanm via AccessMonster.com
  • Start date
G

Gaetanm via AccessMonster.com

Hope someone can help on this.

I have an a form with a sub form and I’m trying to get some calculated
results
From my sub to show up in my main form.

The Main Form is Job_Sheet_2

The Sub Form is work_hours_sub

On the sub I have the following fields that are populated from a query. The
criteria for the query comes from a combo box on the main form.

JobID
EmployeeID
StopDate
HundredTime

The following are field that I added
Labor_charge { Fixed Value}
Extended { =[Labor_Charge]*[hundredtime}

In the footer of my Sub I have the following

Text12 { =Sum([extended]) }

On my main form I have a text box that I would like to see the results of
sub text12
fill in.

text154 { =[Work_hours_sub].[Form]![text12] }

The results I get in the txt154 box is #ERROR


Any Ideas?

Gaetanm
 
A

Allen Browne

Some things to check:

1. Open the main form in design view.
Right-click the edge of the subform control, and choose Properites.
Examine its Name property (Other tab of Properties box.)
You may find the Name is different from the SourceObject.
That is the name of the subform control may not be the same as the name of
the form loaded into it. You must use its Name (not the name of its
SourceObject) in the Control Source of Text154.

2. You have a text box in the "footer" of the subform. Is this the Page
Footer section? Or the Form Footer? It must be in the Form Footer. The
Control Source is right for the field described above. It may help to again
set the Format property to Currency. Then open the subform directly (from
the database window) and check that the total shows correctly when you have
the form in Continuous view.

3. The subform is populated from a query. I wasn't clear if the Extended
field was in the query, or just in the Control Source of a text box on the
subform. If it's not in the query, add it there by typing the expression
into a fresh column in the Field row in query design:
Extended: [Labor_Charge] * [hundredtime]
or possibly:
Extended: CCur(Nz(Round([Labor_Charge] * [hundredtime], 2), 0))
Then set the properties of the text box in your form to:
Control Source Extended
Name Extended
Format Currency

4. If it's still not solved, try temporarily removing all other calculated
controls on the form. This eliminates the possibility that the problem could
be elsewhere.
 

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