Solved

Form Subform reference issue

Posted on 2014-02-05
2
466 Views
Last Modified: 2014-02-05
I have this in the control source of a field on a form:

=DSum("[ShipQty]","tblShipmentDetails","[ReadyID] = " & [Forms]![subfrmReady]![txtReadyID])

But it doesn't work and I think the reason is because I have to somehow reference the main form prior to the    [Forms]![subfrmReady]![txtReadyID]  part of the line.

??
0
Comment
Question by:SteveL13
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 39835910
try this

=DSum("[ShipQty]","tblShipmentDetails","[ReadyID] = " & [Forms]![Name Of MAIN Form][subfrmReady].Form![txtReadyID])


change "Name Of MAIN Form" with the actual name of the main form

if that does not work,

change "subfrmReady" with the name of the control that house the subform
0
 
LVL 34

Assisted Solution

by:PatHartman
PatHartman earned 250 total points
ID: 39836151
A form only has one current record.  When you reference a subform from it's parent form or some other form, the ONLY record you can reference this way is the FIRST record in the subform's RecordSource.  Is that your intention?  Or is that what you think is wrong?

Tell us what you are trying to sum and we can offer another suggestion.  

A simple way to get a total for the subform's RecordSource is to add controls to the footer of the subform - they don't need to be visible.
=Sum(fld1)

Then in the main form, you have a control that references the control in the subform's footer.
= sfrmYoursubform.Form!txtSumOfFld1
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now