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

G

Greg

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top