dynamic filter?

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.
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top