Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form Subform reference issue

Posted on 2014-02-05
2
Medium Priority
?
522 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 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 39

Assisted Solution

by:PatHartman
PatHartman earned 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

721 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