Hi All,
I am having trouble with a report calculation.
My report is grouped by YEARMONTH and then by JOBTYPE.
YEARMONTH is numeric and JOBTYPE is text. Details are hidden as they number in the hundreds.
I have a query that is to run after the user chooses a date from a combo box. The combo box is called SelectYearMonth and is populated by YEARMONTH in HBELP_FINAL_Q. This part works great.
Once the YEARMONTH is selected, I need to calculate the total Pages for each JOBTYPE for the chosen YEARMONTH. There are four JOBTYPES and the types appear on the report correctly.
Here is where I run into problems, how to calculate the page totals for the YEARMONTH selected by the user by JOBTYPE. The total is to be displayed in a text box called TotalPagesTextbox that I have in the JOBTYPE footer. The AfterUpdate() code I am trying to use is:
Me.TotalPagesTextbox = DSum("Pages", "HBELP_FINAL_Q", "YEARMONTH = " & [SelectYearMonth] & "' AND JOBTYPE = '" & Me.[JOBTYPE] & "'")
I know there is something I am missing in the syntax here.
I have a general report that uses the code:
Me.TotalPagesTextbox = DSum("Pages", "HBELP_FINAL_Q", "YEARMONTH = " & [SelectYearMonth])
This code works great for the general report and it gives me an accurate total of all pages for the month. I want to break the information down in detail of how many pages for each JOBTYPE.
Can you please help?
Thanks,
Diana"
I am having trouble with a report calculation.
My report is grouped by YEARMONTH and then by JOBTYPE.
YEARMONTH is numeric and JOBTYPE is text. Details are hidden as they number in the hundreds.
I have a query that is to run after the user chooses a date from a combo box. The combo box is called SelectYearMonth and is populated by YEARMONTH in HBELP_FINAL_Q. This part works great.
Once the YEARMONTH is selected, I need to calculate the total Pages for each JOBTYPE for the chosen YEARMONTH. There are four JOBTYPES and the types appear on the report correctly.
Here is where I run into problems, how to calculate the page totals for the YEARMONTH selected by the user by JOBTYPE. The total is to be displayed in a text box called TotalPagesTextbox that I have in the JOBTYPE footer. The AfterUpdate() code I am trying to use is:
Me.TotalPagesTextbox = DSum("Pages", "HBELP_FINAL_Q", "YEARMONTH = " & [SelectYearMonth] & "' AND JOBTYPE = '" & Me.[JOBTYPE] & "'")
I know there is something I am missing in the syntax here.
I have a general report that uses the code:
Me.TotalPagesTextbox = DSum("Pages", "HBELP_FINAL_Q", "YEARMONTH = " & [SelectYearMonth])
This code works great for the general report and it gives me an accurate total of all pages for the month. I want to break the information down in detail of how many pages for each JOBTYPE.

Can you please help?
Thanks,
Diana"