A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pulling sum of a subform to another form



 
 
Thread Tools Display Modes
  #1  
Old May 26th, 2004, 02:41 PM
DDarney
external usenet poster
 
Posts: n/a
Default Pulling sum of a subform to another form

I have an estimating form that shows the total time estimated for each process. Each process ( printing, cutting, packaging, etc.) is entered in a subform. Regardless of how many lines are entered the total time shows up on the estimating form. My problem is when we try to pull that time from the estimating form to our work order form. For example, if the printing subform (on the estimating form) has more than 5 lines the time shows up on the work order as zero. If it has 5 or less lines, it comes across fine. Other subforms on the estimating form work fine with 6 or 7 lines before the come across as zero. I have tried using nz([subform_name].Form!field_name,0) which works on the main estimating form and I have also tried using IIf([subform_name].Form!field_name is Null, 0, [subform_name].Form!field_name) which also works on the main estimating form. But both have the same problem when pulled to the work order form. Thank you in advance.

Daryl
  #2  
Old May 26th, 2004, 07:01 PM
DDarney
external usenet poster
 
Posts: n/a
Default Pulling sum of a subform to another form



----- DDarney wrote: -----

I have an estimating form that shows the total time estimated for each process. Each process ( printing, cutting, packaging, etc.) is entered in a subform. Regardless of how many lines are entered the total time shows up on the estimating form. My problem is when we try to pull that time from the estimating form to our work order form. For example, if the printing subform (on the estimating form) has more than 5 lines the time shows up on the work order as zero. If it has 5 or less lines, it comes across fine. Other subforms on the estimating form work fine with 6 or 7 lines before the come across as zero. I have tried using nz([subform_name].Form!field_name,0) which works on the main estimating form and I have also tried using IIf([subform_name].Form!field_name is Null, 0, [subform_name].Form!field_name) which also works on the main estimating form. But both have the same problem when pulled to the work order form. Thank you in advance.

Daryl

I should add the code behind this. There is a combo box on the work order form that is populated with the different quantities that we quoted. When one of the quantities is selected this code is run:

If Me![qty to make] = Forms!new_est!q1 Then
Me![Estimated Print Time] = Forms!new_est!printQ1_hours
Me![Estimated Die Cut Time] = Forms!new_est!dieplotQ1_hours
Me![Estimated Plotter Cut Time] = Forms!new_est!plotterQ1_hours
Me![Estimated Lamination Time] = Forms!new_est!rolllamQ1_hours
Me![Estimated Hand Application Time] = Forms!new_est!handlamQ1_hours
Me![Estimated Punch Out Time] = Forms!new_est!punchoutQ1_hours
Me![Estimated Inspection Time] = Forms!new_est!testQ1_hours
Me![Estimated Packaging Time] = Forms!new_est!packageQ1_hours
Me![TimeToCompleteShearCut] = Forms!new_est!shearQ1_hours

There are more If's for when the other quantities are selected. Hopefully this will explain better.

Daryl
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.