Using Acccess 2010. A church database.
I have an unbound form called "frmDateAndSeriesSelector"
On it there are 4 unbound text boxes. Two are for entering dates and are named "txtStartDate" and "txtEndDate". The other two are for entering Envelope Numbers, and are named "txtSeriesStart" and "txtSeriesEnd"
The purpose is to allow the user to determine donations between two dates for a series of Envelope Number donors.
When these text box controls are filled in, and the Preview command button is pushed, the result is "There is no data for the time period selected."
However, there is data there. Below is the Record Source for the report. When the report is run by itself, the parameters are called for, filled in, and everything works fine. I also have a query which is the same formulation and it runs fine.
Can anyone indicate why the result is "No Data" when called from the form? Or a better way to make this happen?
Thanks.
Tom
I have an unbound form called "frmDateAndSeriesSelector"
On it there are 4 unbound text boxes. Two are for entering dates and are named "txtStartDate" and "txtEndDate". The other two are for entering Envelope Numbers, and are named "txtSeriesStart" and "txtSeriesEnd"
The purpose is to allow the user to determine donations between two dates for a series of Envelope Number donors.
When these text box controls are filled in, and the Preview command button is pushed, the result is "There is no data for the time period selected."
However, there is data there. Below is the Record Source for the report. When the report is run by itself, the parameters are called for, filled in, and everything works fine. I also have a query which is the same formulation and it runs fine.
Code:
SELECT tblNewGivings.EnvNbr, Switch([AssignedTo]="A",[FirstName] & " " & IIf(IsNull([LastName2]),(IIf(IsNull([FirstName2]),"","& " & [FirstName2] & " ") & [LastName]),[LastName] & " & " & [FirstName2] & " " & [LastName2]),[AssignedTo]="B",[FirstName] & " " & [LastName],[AssignedTo]="C",[FirstName2] & " " & [LastName]) AS CreditTo, Sum(tblNewGivings.Local) AS SumOfLocal, Sum(tblNewGivings.[M and S]) AS [SumOfM and S], Sum(tblNewGivings.Building) AS SumOfBuilding, Sum(tblNewGivings.Memorial) AS SumOfMemorial, Sum(tblNewGivings.Other) AS SumOfOther, Sum([Local]+[M and S]+[Building]+[Memorial]+[Other]) AS Total, tblEnvelopeNumbers.StartDate, tblEnvelopeNumbers.EndDate
FROM tblTrinity INNER JOIN (tblNewGivings INNER JOIN tblEnvelopeNumbers ON tblNewGivings.EnvNbr = tblEnvelopeNumbers.EnvNbr) ON tblTrinity.UniqueID = tblEnvelopeNumbers.UniqueID
WHERE (((tblNewGivings.[Date Given]) Between [StartDate] And [EndDate] And (tblNewGivings.[Date Given]) Between [Forms]![frmDateAndSeriesSelector]![txtStartDate] And [Forms]![frmDateAndSeriesSelector]![txtEndDate]))
GROUP BY tblNewGivings.EnvNbr, Switch([AssignedTo]="A",[FirstName] & " " & IIf(IsNull([LastName2]),(IIf(IsNull([FirstName2]),"","& " & [FirstName2] & " ") & [LastName]),[LastName] & " & " & [FirstName2] & " " & [LastName2]),[AssignedTo]="B",[FirstName] & " " & [LastName],[AssignedTo]="C",[FirstName2] & " " & [LastName]), tblEnvelopeNumbers.StartDate, tblEnvelopeNumbers.EndDate
HAVING (((tblNewGivings.EnvNbr)>0 And (tblNewGivings.EnvNbr) Between [Forms]![frmDateAndSeriesSelector]![txtSeriesStart] And [Forms]![frmDateAndSeriesSelector]![txSeriesEnd]))
ORDER BY tblNewGivings.EnvNbr;
Can anyone indicate why the result is "No Data" when called from the form? Or a better way to make this happen?
Thanks.
Tom