Solved

Form Subform reference issue

Posted on 2014-02-05
2
488 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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 35

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

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…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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