I
idtjes3
Hello all,
The other day I was thinking that maybe in a few years some data would be
irrelevant to my company(ie fluctuations in market price and what not) and
that only the more recent information would be useful. So with that in mind,
I want to be able to set up my report queries to have the option to filter by
year. On the form i use to launch the report I have a check box [DisplayYr]
and 2 text boxes in which the user would enter a year range; lets say
2002-2008. Those boxes are labeled [YrStart] and [YrEnd]. There maybe time
however that the company does want all the years which is why I want to drive
this with a check box.
My plan is this. The report query will look at the form and see if the
check box = True. if it does, then it will look to the [YrStart] and [YrEnd]
boxes for which values it should be searching between. if the box is not
checked, then the query will list every year in the database. So I was
thinking this is my equation:
IIF(Nz([Forms]![Project Inquiry].[DisplayYr]),*, Between [Forms]![Project
Inquiry].[YrStart] And [Forms]![Project Inquiry].[YrEnd]
The only problem is I'm not sure how to set the text box format for
[YrStart] and [YrEnd] so that the "Year" is understood by Ms access. Like if
its searching through dates, how does it know the number I enter lets say
2004 should include a date of 1/12/2004 in its query? I guess I understand
the concept behind it I'm just a little unsure of the coding aspect of it.
Sorry for the novel
The other day I was thinking that maybe in a few years some data would be
irrelevant to my company(ie fluctuations in market price and what not) and
that only the more recent information would be useful. So with that in mind,
I want to be able to set up my report queries to have the option to filter by
year. On the form i use to launch the report I have a check box [DisplayYr]
and 2 text boxes in which the user would enter a year range; lets say
2002-2008. Those boxes are labeled [YrStart] and [YrEnd]. There maybe time
however that the company does want all the years which is why I want to drive
this with a check box.
My plan is this. The report query will look at the form and see if the
check box = True. if it does, then it will look to the [YrStart] and [YrEnd]
boxes for which values it should be searching between. if the box is not
checked, then the query will list every year in the database. So I was
thinking this is my equation:
IIF(Nz([Forms]![Project Inquiry].[DisplayYr]),*, Between [Forms]![Project
Inquiry].[YrStart] And [Forms]![Project Inquiry].[YrEnd]
The only problem is I'm not sure how to set the text box format for
[YrStart] and [YrEnd] so that the "Year" is understood by Ms access. Like if
its searching through dates, how does it know the number I enter lets say
2004 should include a date of 1/12/2004 in its query? I guess I understand
the concept behind it I'm just a little unsure of the coding aspect of it.
Sorry for the novel