Hi,
I have a kalender-form where i have subforms to represent the days.
In the subform data is loaded and then the back color of a textfield in that sub is set depending on different values.
When i open the subform, everything works fine, but when i open the kalender form, only a part of the data gets colored.
When i hit the 'vandaag' button twice, or when i select a value in my combobox and then select that value for a second time it all works perfect.
in the subform i have the following code to color the textfields:
The value of option, catid, and subcatid ar fields in my form to depend what color the field txtnaam should get.
if I load the subform i looks like this:
When i load the calendar form, it loads al the data, but the color is not set everywhere.
Tnx for your help with this problem.
Steven
I have a kalender-form where i have subforms to represent the days.
In the subform data is loaded and then the back color of a textfield in that sub is set depending on different values.
When i open the subform, everything works fine, but when i open the kalender form, only a part of the data gets colored.
When i hit the 'vandaag' button twice, or when i select a value in my combobox and then select that value for a second time it all works perfect.
in the subform i have the following code to color the textfields:
Code:
Private Sub details_paint()
Dim ROOD As Long
Dim Groen As Long
Dim Geel As Long
Dim GRIJS As Long
Dim LBL As Long
Dim BL As Long
Dim WIT As Long
Dim ZWART As Long
Dim KLEUR As Long
WIT = RGB(255, 255, 255)
ROOD = RGB(255, 127, 80)
Groen = RGB(0, 205, 0)
Geel = RGB(255, 215, 0)
LBL = RGB(99, 184, 255)
BL = RGB(202, 255, 255)
GRIJS = RGB(205, 197, 191)
If Optie = True Then
KLEUR = GRIJS
Else
Select Case CatID
Case 1
Select Case SubCatID
Case 1
KLEUR = LBL
Case 2
KLEUR = BL
Case Else
KLEUR = LBL
End Select
Case 2
KLEUR = ROOD
Case 3
KLEUR = Groen
Case 4
KLEUR = Geel
Case Else
KLEUR = WIT
End Select
End If
Me.Section(acDetail).Controls("txtnaam").BackColor = KLEUR
End Sub
The value of option, catid, and subcatid ar fields in my form to depend what color the field txtnaam should get.
if I load the subform i looks like this:
When i load the calendar form, it loads al the data, but the color is not set everywhere.
Tnx for your help with this problem.
Steven
Last edited: