Solved

Form Subform reference issue

Posted on 2014-02-05
2
512 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 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 38

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

636 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