View Single Post
  #2  
Old June 7th, 2010, 06:59 PM posted to microsoft.public.access.forms
nrgins via AccessMonster.com
external usenet poster
 
Posts: 3
Default Form Subform DLookup

Your post is not clear. But, to get a value located on the subform from the
main form's code module, use this syntax:

Me.SubformcontrolName.Form!SubformValue

where SubformcontrolName is the name of the control on the main form that
holds the subform, and SubformValue is the field on the subform that you want
to look up.

If you want to sum values on a subform, simply put a (hidden or not hidden)
control in the subform's footer, and set its controlsource value to "=Sum(
[ControlName])" (without the quotes) where ControlName is the name of the
control you want to sum. You can then just refer to that summation control
from the main form using the above syntax.

HTH,

Neil


John wrote:
Team,

I have a Form / Subform (with tabs)

On the Subform, I want to:
1. Sum values located on the Form to values located on the Subform.
2. Be able to add a new record for a subsequent Change Order.

The latest attempt has been to display the sum is:
Private Sub txt_Change_Order_Current_Agreement_Value_AfterUpda te()
Me!txt_Change_Order_Current_Agreement_Value =
DLookup("ZPCM_Agreement_Value", "ZPCM", "ZPCM_ID=" & Me!txt_ZPCM_ID)
End Sub

It appears that the sum and the adding of a new record are mutually
exclusive. Is my assumption correct?

---
Thanks for your time...

John


--
Message posted via http://www.accessmonster.com