Urgent !!! - Values from Subform - #Error if no records in Subform and Only grabs first subform reco

Discussion in 'Microsoft Access Forms' started by Greg, Feb 17, 2005.

  1. Greg

    Greg Guest

    Please help!!

    I have two subforms and need to get the value totals from one subform to the
    other, based on multiple criteria.


    The criteria to include the totals (SumOfConfirmed) into From A
    (qry_Projection_subform) from Form B (qry_Buyin_Totals subform) are whenever
    the Product_Code and Whse both match in each form. The Product_Code/Whse
    combination only appears once in each form.

    In Form A I have included a text box with the control source:

    =IIf([Product_Code]=Forms!frm_Projection![qry_Buyin_Totals
    subform].Form!Product_Code And [Whse]=Forms!frm_Projection![qry_Buyin_Totals
    subform].Form!Whse,Forms!frm_Projection![qry_Buyin_Totals
    subform].Form!SumOfConfirmed,0)


    If there are no records (matching or not) in Form B, then I get the result
    #ERROR.

    If there are records, only if the record in Form A matches the first record
    in Form B do I get the proper results ... otherwise 0 (zero) appears.

    Any help you can provide would be greatly appreciated.

    Greg
     
    Greg, Feb 17, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Boyce
    Replies:
    5
    Views:
    298
    Jeff Boyce
    Aug 6, 2004
  2. Guest
    Replies:
    1
    Views:
    246
    Allen Browne
    Dec 26, 2004
  3. Guest

    Sample Databases up For Grabs?

    Guest, Dec 3, 2006, in forum: Microsoft Access Forms
    Replies:
    6
    Views:
    127
    Larry Linson
    Dec 4, 2006
  4. Guest
    Replies:
    0
    Views:
    163
    Guest
    Feb 20, 2007
  5. Guest
    Replies:
    2
    Views:
    325
    Guest
    Apr 18, 2007
Loading...

Share This Page