generate report base on date

  • Thread starter Thread starter shida ABD KADIR via AccessMonster.com
  • Start date Start date
S

shida ABD KADIR via AccessMonster.com

anyone please help!

what must i do if i want to generate monthly report where the date is input
by user.for example if user want to view the april report, so he enter the
april word then all the activities on april has been view
 
First why use the word and not a number. entering a word
can cause only mistakes?
I you insist in entring the word, is it connected to a
combo? if yes then use the number in the combo that relate
to the word April=4.
and then you can open the report as follow
docmd.OpenReport "reportname",,,"month(Mydate)=" &
ParmMonthNumberFromComboOrText

to get the right filter if the user enter the month than
use the following:
docmd.OpenReport "reportname",,,"format(MyDate,"mmmm")
='" & ParmMonthText & "'"
 
Don't forget that if you use month only when you ask for the report you will
get data from April 2005, April 2004, etc.
Unless you always have only the current year's figures in your table (even
if you only started, you have to assume that next year you will be using the
same database) you should always account for the year.
I would use something like: Year(trxDate) = Year(Now()) AND Month(trxdate) =
4, where you obtain 4 from the combo or whatever.

Professor Mike L
Check out my complete Access tutorial
at www.profsr.com
 
Back
Top