Hi, i have a form with a continuous subform based on a sowing calendar table which has 6 fields: FromDay, FromMonth, ToDay and ToMonth, ExactDay, ExactMonth (that is, the sowing can be an exact day or in a short period of time). In the subform I want to represent where is the sowing moment into the year, through an horizontal band marked with 'ene', 'feb', all along it until 'dec'.
For representing where is in that band the sowing moment I want the band shows a different color in this period or day: for that, I have put 365 textboxes over the band all them with transparent background, and with conditional formatting: if its value is 1 its background is red, if its value is 0 there's no format condition. For stablishing its value, in its Control source property there's a calling to a function: for example, in the first textbox corresponding to the day 1 ene it is:
= FillingCalendarBand(1;[FromDay];[FromMonth];[ToDay];[ToMonth];[ExactDay];[ExactMonth])
This function calculates if the day 1 ene is into the sowing period, and return the value 0 in negative case and the value 1 in positive case. And so on for the 365 days (365 textboxes). I haven't found a better way of going around the matter of representing sowing period.
The problem could seem what the link said about conditional formatting in calculated controls: indeed it's an endless loop that recalculates time and time again the day 1 ene case (I have put a MsgBox in the function that gives the first argument received -day number from 1 to 365- and MsgBox with number 1 appears without stopping). But I have removed the conditional formatting and exactly the same problem keeps being: the MsgBox with number 1 keeps appearing without stopping. It was only a test because I really need the conditional formatting to implement the calendar band in this way. I have also tested the conditional formatting programmatically, with the same result.
This problem only occurs in Access 2002 in Windows XP without SP3, i haven't yet tested in Access 2003. The working is correct in Access 2000 (Windows XP with SP2), Access 2002 (Windows XP with SP3), Access 2003 (Windows XP with SP2, Windows Vista) and Access 2007 (Windows XP with SP2, Windows Vista).
Can anybody say where is the problem? Or if there can be a better way of doing?
Thanks in advance for any help.
For representing where is in that band the sowing moment I want the band shows a different color in this period or day: for that, I have put 365 textboxes over the band all them with transparent background, and with conditional formatting: if its value is 1 its background is red, if its value is 0 there's no format condition. For stablishing its value, in its Control source property there's a calling to a function: for example, in the first textbox corresponding to the day 1 ene it is:
= FillingCalendarBand(1;[FromDay];[FromMonth];[ToDay];[ToMonth];[ExactDay];[ExactMonth])
This function calculates if the day 1 ene is into the sowing period, and return the value 0 in negative case and the value 1 in positive case. And so on for the 365 days (365 textboxes). I haven't found a better way of going around the matter of representing sowing period.
The problem could seem what the link said about conditional formatting in calculated controls: indeed it's an endless loop that recalculates time and time again the day 1 ene case (I have put a MsgBox in the function that gives the first argument received -day number from 1 to 365- and MsgBox with number 1 appears without stopping). But I have removed the conditional formatting and exactly the same problem keeps being: the MsgBox with number 1 keeps appearing without stopping. It was only a test because I really need the conditional formatting to implement the calendar band in this way. I have also tested the conditional formatting programmatically, with the same result.
This problem only occurs in Access 2002 in Windows XP without SP3, i haven't yet tested in Access 2003. The working is correct in Access 2000 (Windows XP with SP2), Access 2002 (Windows XP with SP3), Access 2003 (Windows XP with SP2, Windows Vista) and Access 2007 (Windows XP with SP2, Windows Vista).
Can anybody say where is the problem? Or if there can be a better way of doing?
Thanks in advance for any help.