One way is to play with the 4th argument (WhereCondition) of the DoCmd.OpenReport method:
strStartDate = "#" & Format(Me![Name of start date control], "m/dd/yyyy") & "#"
strEndDate = "#" & Format(Me![Name of end date control], "m/dd/yyyy") & "#"
strCriteria = "[Name of date field] Between " & strStartDate & " And " & strEndDate
DoCmd.OpenReport "Name of report", acViewPreview, , strCriteria
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Mr.PH
I'm very thankful for your help , what you wrote was very
helpful and it worked out.
But,if you can just help me in finding a way to get the total of numbers which appear in specific field in the report.
I tried to use :
=sum([Name of the field])
but it didn't work.
Thank you for help, but there is another thing:
How can I display information in the report depend on the period of time and the name entered at the same time by the user ?
I will be very grateful if you help me in that also.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.