- Access 2003 on Windows 7
I have a report grouped by sales person then customer. In the customer group footer I show the customer name, sales for Q1 2015 (calculated field) and sales for Q1 2016 (calculated field). The 2 calculated fields are called txtQ1a and txt Q1b.
If both txtQ1a and txtQ1b are blank or zero, I want to hide that customer. Here's what I've tried, though it's commented out now.
Private Sub grpCustName_Format(Cancel As Integer, FormatCount As Integer)
'Me.grpCustName.Visible = (Nz(txtQ11Amt.Text) = 0) And (Nz(txtQ12amt.Text) = 0)
'Me.grpCustName.Visible = (Nz(txtQ11Amt) = 0) And (Nz(txtQ12amt) = 0)
'Cancel = (Nz(txtQ11Amt.Text) = 0) And (Nz(txtQ12amt.Text) = 0)
End Sub
I've tried several things but keep getting an "invalid procedure call" before my code is even run. The "invalid procedure call" highlights in yellow the function header that starts with "Private grpCustName_Format...".
Did I forget to link a library or something? What could be wrong here?
Thank you.
EDIT: My formula in the each Q1 2015 sales box: =DSum("[sls_amt]","tblSalesLastYear","[sls_amt] <> 0 and [billed_dt] >= 20150101 and [billed_dt] <= 20150331 and [cus_no] = [txtCustno] ")
. Same formula in Q1 2016 sales box but dates are different.