The sql for the record source for the report is
The StartDate and EndDate are fed from a form, frmPerfectAttendance, "txtStartDate" and "txtEndDate" text box controls.
On a command button I put the following
I also tried
I still get prompted for StartDate and EndDate paremeters.
Any thoughts?
Thanks.
Tom
Code:
SELECT qryAllDatesAndMembers.MemberID, qryAllDatesAndMembers.MonthYear, qryAllDatesAndMembers.Required, Nz([MeetingsAttended],0) AS MeetingsAttendedCount, nz([Makeups],0) AS MakeupCount, IIf(nz([Makeups],0)>4,4,nz([MakeUps],0)) AS MakeUpCredit, IIf([MakeUpCredit]+nz([MeetingsAttended])>=[Required],"Credit","NoCredit") AS CreditedMonth, qryAllDatesAndMembers.FullName, qryAllDatesAndMembers.LastName, qryAllDatesAndMembers.PreferredName
FROM (qryAllDatesAndMembers LEFT JOIN qryCountMakeUps ON (qryAllDatesAndMembers.MonthYear = qryCountMakeUps.MeetingMonth) AND (qryAllDatesAndMembers.MemberID = qryCountMakeUps.MemberID)) LEFT JOIN qryCountMeetingsAttended ON (qryAllDatesAndMembers.MonthYear = qryCountMeetingsAttended.MeetingMonth) AND (qryAllDatesAndMembers.MemberID = qryCountMeetingsAttended.MemberID)
WHERE (((qryAllDatesAndMembers.MonthYear)>=[StartDate] And (qryAllDatesAndMembers.MonthYear)<=[EndDate]))
ORDER BY qryAllDatesAndMembers.MemberID, qryAllDatesAndMembers.MonthYear DESC , qryAllDatesAndMembers.LastName, qryAllDatesAndMembers.PreferredName;
The StartDate and EndDate are fed from a form, frmPerfectAttendance, "txtStartDate" and "txtEndDate" text box controls.
On a command button I put the following
Code:
Dim stDocName As String
stDocName = "rptFullStatsSelectedDates"
DoCmd.OpenReport stDocName, acPreview, , "([StartDate] = #" & Forms!frmPerfectAttendance!txtStartDate & "#) AND ([EndDate] = #" & Forms!frmPerfectAttendance!txtEndDate & "#) "
I also tried
Code:
DoCmd.OpenReport stDocName, acViewPreview, , "([StartDate] = Format(Forms!frmPerfectAttendance!txtStartDate,'\#mm\\/yyyy\#') AND ([EndDate] = Format(Forms!frmPerfectAttendance!txtEndDate,'\#mm\/yyyy\#')"
I still get prompted for StartDate and EndDate paremeters.
Any thoughts?
Thanks.
Tom