dynamic filter?

  • Thread starter Thread starter Frank Situmorang
  • Start date Start date
F

Frank Situmorang

Hello,

I have the report layout for Date events like this:

No. Name Date of Birth Date of Marriage Date of Baprized...etc
1. Mr. X Jan 11,2009 ..... .............

How can assingned the form filterfor certain range, for example how many
babies were born in 1 Jan 2009 until 24 Feb 2009 using like this:
BETWEEN [Forms]![frmReportDates_All
DateEvents]![txtBegDate] AND
[Forms]![frmReportDates_All DateEvents]![txtEndDate]
Can give us option which date to filter.

Thanks very much.
 
Frank said:
I have the report layout for Date events like this:

No. Name Date of Birth Date of Marriage Date of Baprized...etc
1. Mr. X Jan 11,2009 ..... .............

How can assingned the form filterfor certain range, for example how many
babies were born in 1 Jan 2009 until 24 Feb 2009 using like this:
BETWEEN [Forms]![frmReportDates_All
DateEvents]![txtBegDate] AND
[Forms]![frmReportDates_All DateEvents]![txtEndDate]
Can give us option which date to filter.


Modify the code in the form's open report button's Click
event to look something like

stWhere = "[Date of Birth] BETWEEN " _
& Format(Me.txtBegDate, "\#yyyy-m-d\#") -
& " AND " & Format(Me.txtEndDate, "\#yyyy-m-d\#")
DoCmd.OpenReport stDocName, acViewPreview, , stWhere
 
Back
Top