Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on Report Footer 1

Status
Not open for further replies.

jlg5454

Technical User
Jan 6, 2005
98
US
Hi,

I have a form that is a parameter date form query that lets you pick your start and end date then run the query to receive results.

Everything seems fine except the Report footer keeps returning an #Error for several calculated fields. For Example, I have this calculated field:
=DSum("[NumberofCalls]","Query1","[AorB]='A' And [Vendor]='Sams'") Is this because of Query 1?

Thanks for any advice.
 
Is frmDate open when you are running the report?
[tt]SELECT tbltest.ID, tbltest.NumberofCalls, tbltest.AorB, tbltest.TimeBegin, tbltest.TimeEnd, tbltest.FSCName, tbltest.SalesorService, tbltest.Vendor, tbltest.Dte
FROM tbltest
WHERE (((tbltest.SalesorService)=[forms]![frmDate]![cboType]) AND ((tbltest.Dte) Between [forms]![frmDate]![cbostd] And [forms]![frmDate]![cboedt]));[/tt]

 
No, I have the macro button close the form.

Thanks,
 
In that case, the query will not work. It needs to get the dates from somewhere. If the report has the NumberOfCalls, AorB and Vendor fields, it may be possible to Sum, rather than DSum.
 
Can I sum multiple criteria using sum? I thought that was what Dsum was for when summing for multiple criteria.

Thanks,
Joe
 
Can I somehow enter the two date fields used to query off the form into the reports calculation?
 
DSum is a domain aggregate function, you can use multiple criteria, but what it is for is summing across a table or query, a bit like DlookUp is for looking up a table or query.

You can Sum in this way:
[tt]=Sum(IIf([AorB]='A' And [Vendor]='Sams',[NumberofCalls],0))[/tt]

Why not leave the form open and hidden? I often find it usuful to leave such small forms open for the session when the user is likely to use the same criteria.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top