Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

from sub form to main form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gaetanm - 03 May 2007 22:20 GMT
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
Allen Browne - 04 May 2007 05:15 GMT
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.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hope someone can help on this.
>
[quoted text clipped - 34 lines]
>
> Gaetanm
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.