J
jderrig
I have a form (a dialog box) named Print Reports Dialog Box in which I have
an option box with several choices. I also have an unbound combo box named
Select Area which lists the areas to choose from.
I am adding another option that when you select the area and hit print
preview, another dialog box opens that asks you for the Year and the Account.
This then is supposed to bring up a report that have D functions built into
it. What I am trying to do is get side by side data that not only pulls the
total for the Area but has a column for the Account so that we can compare
how they are doing compared to the rest of the area. A couple of examples of
the D funtions:
=DCount("[CountOfCHSAcctNo]","10% Breakdown Coop Comparison"," ROLE >=.10")
=DAvg("[Sales]","10% Breakdown Coop Comparison"," ROLE <.10")
I have a macro for the Print Reports Dialog Box Where Condition:
=IIf([Forms]![Print Reports Dialog Box]![Select Area] Is Null,"","[Area] =
Forms![Print Reports Dialog Box]![Select Area]")
Query named 10% Breakdown Coop Comparison:
SELECT Profitable.TDtoLE, Profitable.WorkingCapital, Profitable.Sales,
Profitable.GrossRevenue, Profitable.Expenses, Profitable.LocalSavings,
Profitable.MemberEquity, Profitable.LongTermDebt, Profitable.FixedAssets,
Profitable.[Salary/BenefitExp], Profitable.CurrentAssets,
Profitable.CurrentLiabilities, Profitable.InvOtherOrgan, Profitable.Area,
Profitable.TotalSavings, Profitable.[MS/CO], Profitable.CountOfCHSAcctNo,
Profitable.ROLE, Profitable.Year, Profitable.City, Profitable.State, [Account
Information].[Acct name], [Account Information].CHSAcctNo
FROM [Account Information] INNER JOIN Profitable ON [Account
Information].CHSAcctNo = Profitable.CHSAcctNo
GROUP BY Profitable.TDtoLE, Profitable.WorkingCapital, Profitable.Sales,
Profitable.GrossRevenue, Profitable.Expenses, Profitable.LocalSavings,
Profitable.MemberEquity, Profitable.LongTermDebt, Profitable.FixedAssets,
Profitable.[Salary/BenefitExp], Profitable.CurrentAssets,
Profitable.CurrentLiabilities, Profitable.InvOtherOrgan, Profitable.Area,
Profitable.TotalSavings, Profitable.[MS/CO], Profitable.CountOfCHSAcctNo,
Profitable.ROLE, Profitable.Year, Profitable.City, Profitable.State, [Account
Information].[Acct name], [Account Information].CHSAcctNo
HAVING (((Profitable.[MS/CO])="MS" Or (Profitable.[MS/CO])="South") AND
((Profitable.Year)=[forms]![Account]![Year]) AND ((Profitable.State) Like
[Forms]![Account]![Select Area]) AND (([Account
Information].CHSAcctNo)=[forms]![Account]![Account]));
When I run the report, it tells me there is no data. I have tried this
several ways and either get no data or just get back the single Account data
and nothing else.
I need a way to pull all this together in one report. Am I barking up the
wrong tree?
an option box with several choices. I also have an unbound combo box named
Select Area which lists the areas to choose from.
I am adding another option that when you select the area and hit print
preview, another dialog box opens that asks you for the Year and the Account.
This then is supposed to bring up a report that have D functions built into
it. What I am trying to do is get side by side data that not only pulls the
total for the Area but has a column for the Account so that we can compare
how they are doing compared to the rest of the area. A couple of examples of
the D funtions:
=DCount("[CountOfCHSAcctNo]","10% Breakdown Coop Comparison"," ROLE >=.10")
=DAvg("[Sales]","10% Breakdown Coop Comparison"," ROLE <.10")
I have a macro for the Print Reports Dialog Box Where Condition:
=IIf([Forms]![Print Reports Dialog Box]![Select Area] Is Null,"","[Area] =
Forms![Print Reports Dialog Box]![Select Area]")
Query named 10% Breakdown Coop Comparison:
SELECT Profitable.TDtoLE, Profitable.WorkingCapital, Profitable.Sales,
Profitable.GrossRevenue, Profitable.Expenses, Profitable.LocalSavings,
Profitable.MemberEquity, Profitable.LongTermDebt, Profitable.FixedAssets,
Profitable.[Salary/BenefitExp], Profitable.CurrentAssets,
Profitable.CurrentLiabilities, Profitable.InvOtherOrgan, Profitable.Area,
Profitable.TotalSavings, Profitable.[MS/CO], Profitable.CountOfCHSAcctNo,
Profitable.ROLE, Profitable.Year, Profitable.City, Profitable.State, [Account
Information].[Acct name], [Account Information].CHSAcctNo
FROM [Account Information] INNER JOIN Profitable ON [Account
Information].CHSAcctNo = Profitable.CHSAcctNo
GROUP BY Profitable.TDtoLE, Profitable.WorkingCapital, Profitable.Sales,
Profitable.GrossRevenue, Profitable.Expenses, Profitable.LocalSavings,
Profitable.MemberEquity, Profitable.LongTermDebt, Profitable.FixedAssets,
Profitable.[Salary/BenefitExp], Profitable.CurrentAssets,
Profitable.CurrentLiabilities, Profitable.InvOtherOrgan, Profitable.Area,
Profitable.TotalSavings, Profitable.[MS/CO], Profitable.CountOfCHSAcctNo,
Profitable.ROLE, Profitable.Year, Profitable.City, Profitable.State, [Account
Information].[Acct name], [Account Information].CHSAcctNo
HAVING (((Profitable.[MS/CO])="MS" Or (Profitable.[MS/CO])="South") AND
((Profitable.Year)=[forms]![Account]![Year]) AND ((Profitable.State) Like
[Forms]![Account]![Select Area]) AND (([Account
Information].CHSAcctNo)=[forms]![Account]![Account]));
When I run the report, it tells me there is no data. I have tried this
several ways and either get no data or just get back the single Account data
and nothing else.
I need a way to pull all this together in one report. Am I barking up the
wrong tree?