Hi,
I have a report that is based upon a crosstab report which lists data relating to three seperate years. Prior to the report loading the user selects the first of 3 years that the report is to be based upon, e.g. they select 2006 and see data relating to 2006, 2005 and 2004.
The problem i have is that obviously my database might not have data relating to, for example, 2004. The report sets the control sources of three detail fields using:
I was wondering whether there was any way to:
a) Find out whether the field Forms![REPORTS:CompCriteria]![Text24]-1 actually exists in the query?
b) Set the control source to the value of [text24]-1 if the field exists or "unbound" if it doesn't? I tried an IIf statement for this but it didn't work!
Any help greatfully received!
Cheers
I have a report that is based upon a crosstab report which lists data relating to three seperate years. Prior to the report loading the user selects the first of 3 years that the report is to be based upon, e.g. they select 2006 and see data relating to 2006, 2005 and 2004.
The problem i have is that obviously my database might not have data relating to, for example, 2004. The report sets the control sources of three detail fields using:
Code:
Me.Date2.ControlSource = Forms![REPORTS:CompCriteria]![Text24] - 1
**where Text24 holds a four digit date entered by the user (e.g. 2006)
I was wondering whether there was any way to:
a) Find out whether the field Forms![REPORTS:CompCriteria]![Text24]-1 actually exists in the query?
b) Set the control source to the value of [text24]-1 if the field exists or "unbound" if it doesn't? I tried an IIf statement for this but it didn't work!
Any help greatfully received!
Cheers